Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: dwapb: Get rid of legacy platform data

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>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>

+18 -34
+18 -10
drivers/gpio/gpio-dwapb.c
··· 16 16 #include <linux/mod_devicetable.h> 17 17 #include <linux/module.h> 18 18 #include <linux/of.h> 19 - #include <linux/platform_data/gpio-dwapb.h> 20 19 #include <linux/platform_device.h> 21 20 #include <linux/property.h> 22 21 #include <linux/reset.h> ··· 47 48 48 49 #define DWAPB_DRIVER_NAME "gpio-dwapb" 49 50 #define DWAPB_MAX_PORTS 4 51 + #define DWAPB_MAX_GPIOS 32 50 52 51 53 #define GPIO_EXT_PORT_STRIDE 0x04 /* register stride 32 bits */ 52 54 #define GPIO_SWPORT_DR_STRIDE 0x0c /* register stride 3*32 bits */ ··· 64 64 #define DWAPB_NR_CLOCKS 2 65 65 66 66 struct dwapb_gpio; 67 + 68 + struct dwapb_port_property { 69 + struct fwnode_handle *fwnode; 70 + unsigned int idx; 71 + unsigned int ngpio; 72 + unsigned int gpio_base; 73 + int irq[DWAPB_MAX_GPIOS]; 74 + }; 75 + 76 + struct dwapb_platform_data { 77 + struct dwapb_port_property *properties; 78 + unsigned int nports; 79 + }; 67 80 68 81 #ifdef CONFIG_PM_SLEEP 69 82 /* Store GPIO context across system-wide suspend/resume transitions */ ··· 687 674 unsigned int i; 688 675 struct dwapb_gpio *gpio; 689 676 int err; 677 + struct dwapb_platform_data *pdata; 690 678 struct device *dev = &pdev->dev; 691 - struct dwapb_platform_data *pdata = dev_get_platdata(dev); 692 679 693 - if (!pdata) { 694 - pdata = dwapb_gpio_get_pdata(dev); 695 - if (IS_ERR(pdata)) 696 - return PTR_ERR(pdata); 697 - } 698 - 699 - if (!pdata->nports) 700 - return -ENODEV; 680 + pdata = dwapb_gpio_get_pdata(dev); 681 + if (IS_ERR(pdata)) 682 + return PTR_ERR(pdata); 701 683 702 684 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); 703 685 if (!gpio)
-24
include/linux/platform_data/gpio-dwapb.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright(c) 2014 Intel Corporation. 4 - */ 5 - 6 - #ifndef GPIO_DW_APB_H 7 - #define GPIO_DW_APB_H 8 - 9 - #define DWAPB_MAX_GPIOS 32 10 - 11 - struct dwapb_port_property { 12 - struct fwnode_handle *fwnode; 13 - unsigned int idx; 14 - unsigned int ngpio; 15 - unsigned int gpio_base; 16 - int irq[DWAPB_MAX_GPIOS]; 17 - }; 18 - 19 - struct dwapb_platform_data { 20 - struct dwapb_port_property *properties; 21 - unsigned int nports; 22 - }; 23 - 24 - #endif