From patchwork Mon Jan 16 16:28:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9519049 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 380F4600C5 for ; Mon, 16 Jan 2017 16:28:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 242B81FF73 for ; Mon, 16 Jan 2017 16:28:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17653284DA; Mon, 16 Jan 2017 16:28:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D8A21FF73 for ; Mon, 16 Jan 2017 16:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750927AbdAPQ23 (ORCPT ); Mon, 16 Jan 2017 11:28:29 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33182 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbdAPQ22 (ORCPT ); Mon, 16 Jan 2017 11:28:28 -0500 Received: by mail-lf0-f68.google.com with SMTP id x1so7959241lff.0 for ; Mon, 16 Jan 2017 08:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lqjPqxy7qR0953d500FZ+OhCRhXDhJB+31dQRfs69KQ=; b=p783BJhzv9uq8XR0olunabu8qXO61yZvLw+xw56JgXgnSZyIrVYathDQU1CxVkdCSD aXmnJ93HQ+7+trAULHiJEn+BPeFQ8zz9g1VYVimALH+C0lOb82SfxJsL1myOmfWcDihq SZBdKUVAPxrJ/hYaCRuQ1dCpi6cUnuwaQaK2gXPS+ahP06Lsh+q75OnsPwKawPQuXT5O FZnq/1T81mU7aSiOmvh8bXC0o6NDMoU5fimj8Asg9sNe7fV0FowXWAjGpao2nSt8LP19 T/JOR36yltpSXDI/PvnOcrOqdVzeYN6+8Tqtjn+2jVxL6h7n1ge5ifDm2Be3vopmGmjA 2qBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lqjPqxy7qR0953d500FZ+OhCRhXDhJB+31dQRfs69KQ=; b=pqp2LTIldQ+30AmkUItNnVNUt6abeadbdRwC1Dz7o3Dbsp1TGSVAiI9mpDtSf/mLm4 /+rWoP4Xgk9VBTHYlcZ1aY1+TgGVLbeyQG3ivBlaJZ8ff1ROy0XKe/WEcno3M4qSW4z2 hoX/EBZrUtH21u42BGtEkR/ojc6t3NYNlTW4Va8l0h7CpwU8j+I01J4hQI0glsiaCXq8 oPoorfn8jIKlispSVvU6Oh0Cf0BPm7b16e/ie8t7Ttn6+Y/epXUuJZhxRMWo08wepF+R imFlS9Kw59vHFsobdvjA4P1KgVxNh0f3DVyob4lCTvDPk4KuGA9koeg+WlWjabez6hkv 5xcA== X-Gm-Message-State: AIkVDXLtOOZVNDBt2fBjvaVNPW//ZAhcIZM/IDDIsQROdt/wXZSQdtmZRGaWj8y1lav5OA== X-Received: by 10.25.203.87 with SMTP id b84mr11230626lfg.158.1484584106307; Mon, 16 Jan 2017 08:28:26 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id j138sm7556884lfe.19.2017.01.16.08.28.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 08:28:25 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , Kalle Valo Cc: linux-mtd@lists.infradead.org, linux-wireless@vger.kernel.org, Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata Date: Mon, 16 Jan 2017 17:28:18 +0100 Message-Id: <20170116162818.12094-1-zajec5@gmail.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki We have generic place & helpers for storing platform driver data so there is no reason for using custom priv pointer. This allows cleaning up struct bcma_sflash from unneeded fields. Signed-off-by: Rafał Miłecki Acked-by: Kalle Valo Acked-by: Boris Brezillon --- Kalle: This is mtd focused patch, so I guess it should go through mtd tree. Do you find bcma change important enough to care to Ack it? :) --- drivers/mtd/devices/bcm47xxsflash.c | 6 +++--- include/linux/bcma/bcma_driver_chipcommon.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c index 514be04..4decd8c 100644 --- a/drivers/mtd/devices/bcm47xxsflash.c +++ b/drivers/mtd/devices/bcm47xxsflash.c @@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL); if (!b47s) return -ENOMEM; - sflash->priv = b47s; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) b47s->size = sflash->size; bcm47xxsflash_fill_mtd(b47s, &pdev->dev); + platform_set_drvdata(pdev, b47s); + err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0); if (err) { pr_err("Failed to register MTD device: %d\n", err); @@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) static int bcm47xxsflash_bcma_remove(struct platform_device *pdev) { - struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev); - struct bcm47xxsflash *b47s = sflash->priv; + struct bcm47xxsflash *b47s = platform_get_drvdata(pdev); mtd_device_unregister(&b47s->mtd); iounmap(b47s->window); diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index b20e3d5..2f1c690 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h @@ -593,9 +593,6 @@ struct bcma_sflash { u32 blocksize; u16 numblocks; u32 size; - - struct mtd_info *mtd; - void *priv; }; #endif