linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Serge Semin <fancer.lancer@gmail.com>,
	linux-gpio@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-kernel@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 5/6] gpio: dwapb: Get rid of legacy platform data
Date: Mon,  8 Jun 2020 16:42:59 +0300	[thread overview]
Message-ID: <20200608134300.76091-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200608134300.76091-1-andriy.shevchenko@linux.intel.com>

Platform data is a legacy interface to supply device properties
to the driver. In this case we don't have anymore in-kernel users
for it. Just remove it for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-dwapb.c                | 27 +++++++++++++++---------
 include/linux/platform_data/gpio-dwapb.h | 22 -------------------
 2 files changed, 17 insertions(+), 32 deletions(-)
 delete mode 100644 include/linux/platform_data/gpio-dwapb.h

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index e3d7589434eb..de01b8943bd2 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -23,7 +23,6 @@
 #include <linux/property.h>
 #include <linux/reset.h>
 #include <linux/spinlock.h>
-#include <linux/platform_data/gpio-dwapb.h>
 #include <linux/slab.h>
 
 #include "gpiolib.h"
@@ -66,6 +65,19 @@
 
 #define DWAPB_NR_CLOCKS		2
 
+struct dwapb_port_property {
+	struct fwnode_handle *fwnode;
+	unsigned int idx;
+	unsigned int ngpio;
+	unsigned int gpio_base;
+	int irq[32];
+};
+
+struct dwapb_platform_data {
+	struct dwapb_port_property *properties;
+	unsigned int nports;
+};
+
 struct dwapb_gpio;
 
 #ifdef CONFIG_PM_SLEEP
@@ -633,17 +645,12 @@ static int dwapb_gpio_probe(struct platform_device *pdev)
 	unsigned int i;
 	struct dwapb_gpio *gpio;
 	int err;
+	struct dwapb_platform_data *pdata;
 	struct device *dev = &pdev->dev;
-	struct dwapb_platform_data *pdata = dev_get_platdata(dev);
-
-	if (!pdata) {
-		pdata = dwapb_gpio_get_pdata(dev);
-		if (IS_ERR(pdata))
-			return PTR_ERR(pdata);
-	}
 
-	if (!pdata->nports)
-		return -ENODEV;
+	pdata = dwapb_gpio_get_pdata(dev);
+	if (IS_ERR(pdata))
+		return PTR_ERR(pdata);
 
 	gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
 	if (!gpio)
diff --git a/include/linux/platform_data/gpio-dwapb.h b/include/linux/platform_data/gpio-dwapb.h
deleted file mode 100644
index a63010b6e898..000000000000
--- a/include/linux/platform_data/gpio-dwapb.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright(c) 2014 Intel Corporation.
- */
-
-#ifndef GPIO_DW_APB_H
-#define GPIO_DW_APB_H
-
-struct dwapb_port_property {
-	struct fwnode_handle *fwnode;
-	unsigned int	idx;
-	unsigned int	ngpio;
-	unsigned int	gpio_base;
-	int		irq[32];
-};
-
-struct dwapb_platform_data {
-	struct dwapb_port_property *properties;
-	unsigned int nports;
-};
-
-#endif
-- 
2.27.0.rc2


  parent reply	other threads:[~2020-06-08 13:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 13:42 [PATCH v1 0/6] mfd: Make use of software nodes Andy Shevchenko
2020-06-08 13:42 ` [PATCH v1 1/6] gpio: dwapb: Replace irq_shared flag with fwnode type check Andy Shevchenko
2020-06-08 13:42 ` [PATCH v1 2/6] gpio: dwapb: Read GPIO base from snps,gpio-base property Andy Shevchenko
2020-06-10 11:26   ` Linus Walleij
2020-06-10 13:41     ` Andy Shevchenko
2020-06-08 13:42 ` [PATCH v1 3/6] mfd: core: Propagate software node group to the sub devices Andy Shevchenko
2020-06-08 19:25   ` Lee Jones
2020-06-09 12:40     ` Andy Shevchenko
2020-06-17 12:51       ` Lee Jones
2020-06-08 13:42 ` [PATCH v1 4/6] mfd: intel_quark_i2c_gpio: Convert to use software nodes Andy Shevchenko
2020-06-10 11:38   ` Linus Walleij
2020-06-10 13:43     ` Andy Shevchenko
2020-06-08 13:42 ` Andy Shevchenko [this message]
2020-06-10 11:39   ` [PATCH v1 5/6] gpio: dwapb: Get rid of legacy platform data Linus Walleij
2020-06-10 13:47     ` Andy Shevchenko
2020-06-08 13:43 ` [PATCH v1 6/6] gpio: dwapb: Define magic number for IRQ and GPIO lines Andy Shevchenko
2020-06-16 20:02 ` [PATCH v1 0/6] mfd: Make use of software nodes Serge Semin
2020-06-16 21:40   ` Andy Shevchenko
2020-06-16 22:56     ` Serge Semin
2020-06-18  8:56       ` Andy Shevchenko
2020-06-19 22:12         ` Serge Semin
2020-06-20 10:13           ` Andy Shevchenko
2020-06-23  1:49             ` Serge Semin
2020-06-24 12:43               ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200608134300.76091-6-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=fancer.lancer@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).