Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp373867pxb; Thu, 12 Nov 2020 06:08:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrp/72xeyoFu5aoig/qqrPo6Np61nyhevxWetRzYeUIusbaBUast/9D7KCM54VrCc659Si X-Received: by 2002:a5d:410c:: with SMTP id l12mr16544288wrp.173.1605190109582; Thu, 12 Nov 2020 06:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605190109; cv=none; d=google.com; s=arc-20160816; b=tQ23YQkNQxMBAEgcKM57ZtX8DscWNnB95mdwVj/Tssznn1qGt6rGfJYeo9DqfT9xu2 5eZNdttjY96b+ZmPZTY3nzKJF6WZ4kcjm0ms3odOIGJbP/YN7FD7FdvzE1nFfCGjGcD/ QoqziIirhTEqt7p1Fg7mnp17+WQuXqupw9nUbP3MKcGhs6ugQBaruv8PVVMpIwEuDjYT pLGA+1dXaX7Qklf68rK7ujxxMKX+JrRFdxDfCd+W5sAC6uuzrYMcqdlhHsHPT+hmcQew q/iHoZ8FNHIupPioKN68Of1jrBhd5oF7bOVnZPzEchohaFyPvxKpFOIjZU6Ij0xCOcg4 q50Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tGu5oH3VQ7eWe40maLCTjTDEjDF7H6L/YZ+Yi4SWhhQ=; b=vrV6fFACjb5YS+xxqIx5O/qUrpATIJr/qKYbXScqR96cLfXvEUnSMJEIk/cT1WdSuA hRYSBg/Bur4D7FiLpOax8eGjEKNuVTfWjIL9GoFtprKEPXE55EaoG8+XfWsNhm4k/h4/ matzVQTNWWfMlay9lqyEC2SIEdy6EuD0QjkAUB9q3BMmjCcVbZwtZTwbAR+0yH+BnOQ0 F38nW4ydQUy+qiqY3tqKyIlmEECDpK1GPus3QA7sKd2cerZUHt3dkDByHYJ6An2EPZ4P WxwIOpMpeDDIAuxsqMobNJAmuMthF2YNORA6UR5z3In5aF3qAMKuWBUUUjGJ8VwUliTJ wATQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si3790452eje.481.2020.11.12.06.08.05; Thu, 12 Nov 2020 06:08:29 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbgKLOGa (ORCPT + 99 others); Thu, 12 Nov 2020 09:06:30 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:45191 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727934AbgKLOGa (ORCPT ); Thu, 12 Nov 2020 09:06:30 -0500 Received: by mail-oi1-f193.google.com with SMTP id j7so6445397oie.12; Thu, 12 Nov 2020 06:06:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tGu5oH3VQ7eWe40maLCTjTDEjDF7H6L/YZ+Yi4SWhhQ=; b=Gyn/deUUNTYGJ9B3FSwO82A+M06DRLVxBoeYtbU2got9/XWEEXo1rbtwDnp56egkhk 5FtfiQcq+em441kQWLa0yCOOMqVYsYcclQEL1ccB10EisR0+Yhu3KM9wCIc/tiBsxn0l pYwDmPXi8SkyvSA8P1yLtWo4HGpN+KO9ptsOAV2ugLlYSJFn7Bgqeqolowk1+9Z+K+Ow AGfQ2IlEE/L+Cyxmp7Nv9Y3982/W4vcMJU6Wz4lfpiQOLCJTS78ES/OTX+I+stXRMlcn +1uoap5s0ieLvDW/y2ztQzHTNjnoQeC/J0zgQiJMYYAXTntphmEAt57ipWYP9Q42+IoT X7fg== X-Gm-Message-State: AOAM532wbFxDiaStue+eLjTdyWm6MVevdNYWIr0sLcN0uHKrgdyCNRUF u6UE7T/yk/cxBqh8DkfgFsF8mILD8aeZ7aUMptw= X-Received: by 2002:aca:52c9:: with SMTP id g192mr5844659oib.54.1605189987900; Thu, 12 Nov 2020 06:06:27 -0800 (PST) MIME-Version: 1.0 References: <20200916084017.14086-1-huobean@gmail.com> In-Reply-To: <20200916084017.14086-1-huobean@gmail.com> From: Geert Uytterhoeven Date: Thu, 12 Nov 2020 15:06:16 +0100 Message-ID: Subject: Re: [PATCH v2] scsi: ufs-exynos: use devm_platform_ioremap_resource_byname() To: Bean Huo Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, "James E.J. Bottomley" , "Martin K. Petersen" , stanley.chu@mediatek.com, =?UTF-8?B?QmVhbiBIdW8g6ZyN5paM5paMIChiZWFuaHVvKQ==?= , Bart Van Assche , "Winkler, Tomas" , cang@codeaurora.org, scsi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bean, On Wed, Sep 16, 2020 at 10:43 AM Bean Huo wrote: > From: Bean Huo > > Use devm_platform_ioremap_resource_byname() to simplify the code. > > Signed-off-by: Bean Huo Thanks for your patch, which is now commit 2dd39fad92a1f25f ("scsi: ufs: ufs-exynos: Use devm_platform_ioremap_resource_byname()") in v5.10-rc1. > --- a/drivers/scsi/ufs/ufs-exynos.c > +++ b/drivers/scsi/ufs/ufs-exynos.c > @@ -940,7 +940,6 @@ static int exynos_ufs_init(struct ufs_hba *hba) > struct device *dev = hba->dev; > struct platform_device *pdev = to_platform_device(dev); > struct exynos_ufs *ufs; > - struct resource *res; > int ret; > > ufs = devm_kzalloc(dev, sizeof(*ufs), GFP_KERNEL); > @@ -948,24 +947,21 @@ static int exynos_ufs_init(struct ufs_hba *hba) > return -ENOMEM; > > /* exynos-specific hci */ > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vs_hci"); > - ufs->reg_hci = devm_ioremap_resource(dev, res); > + ufs->reg_hci = devm_platform_ioremap_resource_byname(pdev, "vs_hci"); Are you sure this is equivalent? Before, devm_ioremap_resource() was called on "dev" (hba->dev), after it is called on "&pdev->dev" . > if (IS_ERR(ufs->reg_hci)) { > dev_err(dev, "cannot ioremap for hci vendor register\n"); > return PTR_ERR(ufs->reg_hci); > } > > /* unipro */ > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "unipro"); > - ufs->reg_unipro = devm_ioremap_resource(dev, res); > + ufs->reg_unipro = devm_platform_ioremap_resource_byname(pdev, "unipro"); > if (IS_ERR(ufs->reg_unipro)) { > dev_err(dev, "cannot ioremap for unipro register\n"); > return PTR_ERR(ufs->reg_unipro); > } > > /* ufs protector */ > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ufsp"); > - ufs->reg_ufsp = devm_ioremap_resource(dev, res); > + ufs->reg_ufsp = devm_platform_ioremap_resource_byname(pdev, "ufsp"); > if (IS_ERR(ufs->reg_ufsp)) { > dev_err(dev, "cannot ioremap for ufs protector register\n"); > return PTR_ERR(ufs->reg_ufsp); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds