From patchwork Fri Jun 15 01:18:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 138638 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp215458lji; Thu, 14 Jun 2018 18:20:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLaJug1MDofvPwCIcQTpYtWI2qsW4xfNFKlr+hLLKwOBW/tGSQIU//lqVcs43iMSYAcg2HZ X-Received: by 2002:a63:b742:: with SMTP id w2-v6mr4202738pgt.200.1529025605717; Thu, 14 Jun 2018 18:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529025605; cv=none; d=google.com; s=arc-20160816; b=HittvRXZhham42FsFW9FtEx5QnWXtU88Y5Fgu1hzXRRGGRhxtEbUvMLz1GeWrEZ4QA 9k1prlFVJR0v/1Gc8ExScLJtIAQeeED6uMgLCvzUh2lDh4OQlUjyxjjHnQD94kyyKI/C XMCGqIu5WSptgqH/0CZDvvHk+I2WNIDmzBrSEeUcLz2DpF2x+KhfhxWinmU5jlU1uzeD myiN3OnHJBmj1IOI6NI7Z9HJzkBTJ3c4ooijT4BZ7kBXbdS+aKfL9dMbEcJEMup/FmZD NKJ3sA+AM8vZiQ+ihsnJ2RBBhv9kk3SfLrJhQBNlJOIfKqnC4fWQ1Hs7E1VyOsV7sZlr Pwcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature :arc-authentication-results; bh=AeYWW0iCkAI8qP4dcCQAq1aUjYlzY4noI+R5WIK3Lds=; b=Xi8sqYlKWuUbkfgHBPspjZGvr89veRPlPxYqHp3CBAyFXqZungsGkQT+G+EDvtaV0R uh8Gm/M2YJshNjPmZusuv3p4T665d9rqSrx2HboGpET+pA2fM9DAdMHea12ywB+V1vWP seQ/p8ONs8GMBQVzMIVXkuVuoGzRshLANHIBbs71IodjU5L7ztsNoM9QCgh0qIP2f5Ad 9hFO1McsKbFiLNHJMazvINwFYYm3tAR2g5L3midzX9xodY9hlj5oxIF9Pda2YpvcjBWP fWx97d5g8OcRcbYjkB3lMhTpMNgMYLR7KNdFfYA0ftD6PQggGlCE272kfOPNtMVTIc31 fgFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="EvJ5/6HI"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=ztJHRBJV; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id e8-v6si6223013pfi.23.2018.06.14.18.20.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Jun 2018 18:20:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="EvJ5/6HI"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=ztJHRBJV; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AeYWW0iCkAI8qP4dcCQAq1aUjYlzY4noI+R5WIK3Lds=; b=EvJ5/6HIk8NATDV5YDS4+AyK7f y6DwmWDBl16wmRpGeiH41wSIdISkug7pATLq7zFKgpZtlgSgM6xz5CLYXv5bJy6lFTBu3ot0UmR+I ZsPwk0i360X+KtYnkg/tqzdBaIh639/svRsl90kX5k/Q9FGZcP+wz0e/ay+x6ZN+jSnNBEE9kl8+6 tEAYlkeA4PrzOfW6q2CypNTFF38ONC0b6O5t/lyitq59Zw7I41iFA/FXF7DgOT7kv62WqL68jpQV5 +QPgJayYq5Pdskqj9XOBxmEi5oUDePYIK7UW2Ozw0WOJGispA8y2F1ZeoJVuMRFfP0ZDRTdbXWblt TulAACEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTdP8-000383-MC; Fri, 15 Jun 2018 01:19:54 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTdOj-0002so-1x for linux-mtd@lists.infradead.org; Fri, 15 Jun 2018 01:19:31 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w5F1IuMM005465; Fri, 15 Jun 2018 10:18:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w5F1IuMM005465 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1529025539; bh=6+iHk+x2dWO+Qd/UgvvhTtWHsBi6GstNKr7N04OKinM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ztJHRBJVke2gvzj1MsmyWVKd+UrVxKqNiM39Rswfgf9pcjPlK4S9ydSRL5Qjexw17 2ydgotSl/s7GmD8beOmhsRg/GKoCrp9VCW30pkRmxCH5MheciXlCFJHD6FfxJMO9Hn Cb42ZOt//52QeBQ6uo26O5zvDRif5E/1hmqAyytTRjZFRWQtIFIQ0TwySbIZeSc2fZ xCcs31UEeVhMkkUH8GdEwcwmbU6BbzLwJOMDPlQBY8XkSlKXZOkFbWdydcHoQAxvER TLJBWZrbeL9UBNbh6j6/qelNAtO5RfGpZHGd4931DB7ZucOi4AXPYygwl2PgGNEElE W99ygDZV3Q8GA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon Subject: [PATCH v3 2/3] mtd: rawnand: denali_dt: use dev as a shorthand of &pdev->dev Date: Fri, 15 Jun 2018 10:18:51 +0900 Message-Id: <1529025532-22087-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529025532-22087-1-git-send-email-yamada.masahiro@socionext.com> References: <1529025532-22087-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180614_181929_474378_3B12504C X-CRM114-Status: GOOD ( 13.10 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.131.2.75 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kbuild@vger.kernel.org, Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Rob Herring , Miquel Raynal , Brian Norris , David Woodhouse , Marek Vasut MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The probe function references &pdev->dev many times. Add 'dev' as a shorthand. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/denali_dt.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c index ce6239d..afaae37 100644 --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c @@ -81,38 +81,39 @@ MODULE_DEVICE_TABLE(of, denali_nand_dt_ids); static int denali_dt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct resource *res; struct denali_dt *dt; const struct denali_dt_data *data; struct denali_nand_info *denali; int ret; - dt = devm_kzalloc(&pdev->dev, sizeof(*dt), GFP_KERNEL); + dt = devm_kzalloc(dev, sizeof(*dt), GFP_KERNEL); if (!dt) return -ENOMEM; denali = &dt->denali; - data = of_device_get_match_data(&pdev->dev); + data = of_device_get_match_data(dev); if (data) { denali->revision = data->revision; denali->caps = data->caps; denali->ecc_caps = data->ecc_caps; } - denali->dev = &pdev->dev; + denali->dev = dev; denali->irq = platform_get_irq(pdev, 0); if (denali->irq < 0) { - dev_err(&pdev->dev, "no irq defined\n"); + dev_err(dev, "no irq defined\n"); return denali->irq; } res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "denali_reg"); - denali->reg = devm_ioremap_resource(&pdev->dev, res); + denali->reg = devm_ioremap_resource(dev, res); if (IS_ERR(denali->reg)) return PTR_ERR(denali->reg); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_data"); - denali->host = devm_ioremap_resource(&pdev->dev, res); + denali->host = devm_ioremap_resource(dev, res); if (IS_ERR(denali->host)) return PTR_ERR(denali->host); @@ -120,19 +121,19 @@ static int denali_dt_probe(struct platform_device *pdev) * A single anonymous clock is supported for the backward compatibility. * New platforms should support all the named clocks. */ - dt->clk = devm_clk_get(&pdev->dev, "nand"); + dt->clk = devm_clk_get(dev, "nand"); if (IS_ERR(dt->clk)) - dt->clk = devm_clk_get(&pdev->dev, NULL); + dt->clk = devm_clk_get(dev, NULL); if (IS_ERR(dt->clk)) { - dev_err(&pdev->dev, "no clk available\n"); + dev_err(dev, "no clk available\n"); return PTR_ERR(dt->clk); } - dt->clk_x = devm_clk_get(&pdev->dev, "nand_x"); + dt->clk_x = devm_clk_get(dev, "nand_x"); if (IS_ERR(dt->clk_x)) dt->clk_x = NULL; - dt->clk_ecc = devm_clk_get(&pdev->dev, "ecc"); + dt->clk_ecc = devm_clk_get(dev, "ecc"); if (IS_ERR(dt->clk_ecc)) dt->clk_ecc = NULL; @@ -155,7 +156,7 @@ static int denali_dt_probe(struct platform_device *pdev) * Hardcode the clock rates for the backward compatibility. * This works for both SOCFPGA and UniPhier. */ - dev_notice(&pdev->dev, + dev_notice(dev, "necessary clock is missing. default clock rates are used.\n"); denali->clk_x_rate = 200000000; }