Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4900754pxb; Mon, 15 Feb 2021 04:28:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxadijjizQoGg4TZAgXcqcc/ZUVV8zSMbE3PiyCbK/DQFm2h3hVQE7tshcVnb8UekAOY7Fw X-Received: by 2002:a17:906:b19a:: with SMTP id w26mr15162868ejy.296.1613392115757; Mon, 15 Feb 2021 04:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613392115; cv=none; d=google.com; s=arc-20160816; b=HFzRi+WmIIKbUBVeJlcCda9ZkoLd19afRpuJDl+x9ftIoX7y365wBIN7qUFMmKiCfe Ikc+vNXkKe169KQoiZKbRICjDRgEU/L6zOcwjRQtv0tYbrARRYKW1qSsI65+wJcserdb +5ob6tc9pnUd//NMeyx/qWU4PhMITMV2vXttWXE1DdplE9Z/mFiCo+LZCKYW+e3qFGUt lhVuQUej9i1cS0CmSzg5JxqjNC57IfroSbdO5tmN0wynJ8czcU5NhJfuKH3ySHo0hbT6 YaWpZQbVYp0RCXc5lqKgsMSmzQqQSSdG442hMWLlgTvvdV4HdbVyTWWjSohosXjwbLeu qXXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=di3QlYOC5WEv4EDr6COUReMoxV7K/OTtUmZKrNorVP0=; b=oMLoYskm893uW++RfoDLRSOMtzEkCULjeUebneI6/1CZckDmSZL3B/b/Wt+3Va361T FiC+u2wTSFc05/e73y62dLHxEV28+7G3ycACVUzbxESlb3XtfdyRSMHne/0+4VhjFVa9 kpjPriWCBUfqNkoHgb8hri0VU8KrjHn5UQiyy20z2ZzhcOFtFya40K7JF//pl6LXj+O0 DRvyyT3klmDt82yGnNAVhpJFbgxL8v6BgXkdMPe1nu/3QCM6Zu4CauSvih/jxHKyc8MI NEfkzSRcjtz2O8FKk4s54iHEFxYTZuXnjveQr+0G20oQi8tASOf0LpfQk9M9AIneAxjt RNKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si12005993edx.201.2021.02.15.04.28.11; Mon, 15 Feb 2021 04:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbhBOMZX (ORCPT + 99 others); Mon, 15 Feb 2021 07:25:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbhBOMUO (ORCPT ); Mon, 15 Feb 2021 07:20:14 -0500 Received: from mail.marcansoft.com (marcansoft.com [IPv6:2a01:298:fe:f::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 985AAC061574; Mon, 15 Feb 2021 04:19:19 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hector@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id E1A72424A1; Mon, 15 Feb 2021 12:19:13 +0000 (UTC) From: Hector Martin To: linux-arm-kernel@lists.infradead.org Cc: Hector Martin , Marc Zyngier , Rob Herring , Arnd Bergmann , Olof Johansson , Krzysztof Kozlowski , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Will Deacon , Linus Walleij , Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 20/25] tty: serial: samsung_tty: Use devm_ioremap_resource Date: Mon, 15 Feb 2021 21:17:08 +0900 Message-Id: <20210215121713.57687-21-marcan@marcan.st> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210215121713.57687-1-marcan@marcan.st> References: <20210215121713.57687-1-marcan@marcan.st> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This picks up the non-posted I/O mode needed for Apple platforms to work properly. This removes the request/release functions, which are no longer necessary, since devm_ioremap_resource takes care of that already. Most other drivers already do it this way, anyway. Also fix a bug checking the return value, which should use IS_ERR(). Signed-off-by: Hector Martin --- drivers/tty/serial/samsung_tty.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 821cd0e4f870..619bc4864e2a 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1572,26 +1572,11 @@ static const char *s3c24xx_serial_type(struct uart_port *port) } } -#define MAP_SIZE (0x100) - -static void s3c24xx_serial_release_port(struct uart_port *port) -{ - release_mem_region(port->mapbase, MAP_SIZE); -} - -static int s3c24xx_serial_request_port(struct uart_port *port) -{ - const char *name = s3c24xx_serial_portname(port); - - return request_mem_region(port->mapbase, MAP_SIZE, name) ? 0 : -EBUSY; -} - static void s3c24xx_serial_config_port(struct uart_port *port, int flags) { struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - if (flags & UART_CONFIG_TYPE && - s3c24xx_serial_request_port(port) == 0) + if (flags & UART_CONFIG_TYPE) port->type = info->port_type; } @@ -1644,8 +1629,6 @@ static struct uart_ops s3c24xx_serial_ops = { .shutdown = s3c24xx_serial_shutdown, .set_termios = s3c24xx_serial_set_termios, .type = s3c24xx_serial_type, - .release_port = s3c24xx_serial_release_port, - .request_port = s3c24xx_serial_request_port, .config_port = s3c24xx_serial_config_port, .verify_port = s3c24xx_serial_verify_port, #if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL) @@ -1667,8 +1650,6 @@ static const struct uart_ops s3c64xx_serial_ops = { .shutdown = s3c64xx_serial_shutdown, .set_termios = s3c24xx_serial_set_termios, .type = s3c24xx_serial_type, - .release_port = s3c24xx_serial_release_port, - .request_port = s3c24xx_serial_request_port, .config_port = s3c24xx_serial_config_port, .verify_port = s3c24xx_serial_verify_port, #if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL) @@ -1926,8 +1907,8 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, dev_dbg(port->dev, "resource %pR)\n", res); - port->membase = devm_ioremap(port->dev, res->start, resource_size(res)); - if (!port->membase) { + port->membase = devm_ioremap_resource(port->dev, res); + if (IS_ERR(port->membase)) { dev_err(port->dev, "failed to remap controller address\n"); return -EBUSY; } -- 2.30.0