Received: by 10.192.165.156 with SMTP id m28csp773939imm; Thu, 19 Apr 2018 07:21:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx48EdHdGYffC+eN32w7qrX7sDW+ziMfgtmxZTjKOHuM4tBcj64gBVsYRWDTGMyarhGdP5FDL X-Received: by 2002:a17:902:57c7:: with SMTP id g7-v6mr6294350plj.222.1524147701454; Thu, 19 Apr 2018 07:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147701; cv=none; d=google.com; s=arc-20160816; b=zqOTUlIKi9n+g4uijABAwA2uZD0WEqA+la1RncgUxRZCmqyzdu+MpFtoXHQ119Scg/ Yzzax079irv5wjSgDPYJeIGP8gc+oULqVkQudy5a7lwhvE8LEZd8kSa4ZoK3Z4AMWLdw lAYmUiQblZoLLwsDUZtupVLi9MvqaqyDUCNVitRpRitA4yBWG0MqnoF83eM95mcu3cCH t4uSL2q41mkGUDgMdDHdeYy8ZFECOeYOj2uiDtn00wHMFUi5K2PXk46mrmbNjO96RzX+ U2SMcZEPHgJr8lAMKR7bk7jbO4HIPLSaz+lFU19W9EZLujPAaOAIgFbr9LmB/vlYrhsV VdOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=p0g1QUn765wc1VrAju64pL/t+jfAVmR8LHsL8O+BjPQ=; b=ho8EBjaAzIsiaiUwVxz7rrUt7T3sNS6z5Jpd2OAqZq6ZJ1OAH7CGFNEC9iZ/113Cky gfmOypR8Qyl4WinMxsifKGX/YeTjg0rUVfxnqxeYtvMMr/OnnImvNQDHB9MX1+G+mJsr AyVHngO3pohMi2qK2UNGdvWTG3QwDaAWM0zcEEYw1kK65/isBo+P8/8XzKjsMcp61GSK es+VT8BLIjrbEYQ1wX7SN1kh0jpoov9lxj4zvF8dOAbai8rvvQM9H4NLTAWF5be0QWFv Q5x9fHitu4mOQ1dLzQMod5vNxIS3hfSKmIiN2xh87Cs2eARy9c6QCNdfFY7cpNMlEzcE xqTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j123si361424pfd.207.2018.04.19.07.21.27; Thu, 19 Apr 2018 07:21:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753651AbeDSOUQ (ORCPT + 99 others); Thu, 19 Apr 2018 10:20:16 -0400 Received: from sauhun.de ([88.99.104.3]:45322 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbeDSOHC (ORCPT ); Thu, 19 Apr 2018 10:07:02 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id ED6733139C9; Thu, 19 Apr 2018 16:07:00 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Robert Jarzmik , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 29/61] mtd: devices: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:59 +0200 Message-Id: <20180419140641.27926-30-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/mtd/devices/docg3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index c594fe5eac08..802d8f159e90 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c @@ -1470,8 +1470,7 @@ static struct docg3 *sysfs_dev2docg3(struct device *dev, struct device_attribute *attr) { int floor; - struct platform_device *pdev = to_platform_device(dev); - struct mtd_info **docg3_floors = platform_get_drvdata(pdev); + struct mtd_info **docg3_floors = dev_get_drvdata(dev); floor = attr->attr.name[1] - '0'; if (floor < 0 || floor >= DOC_MAX_NBFLOORS) -- 2.11.0