Re: [PATCH 5/5] gpio: ppc44x: tidy up includes and probe

From: Bartosz Golaszewski

Date: Mon Nov 09 2026 - 04:11:06 EST


On Wed, Nov 04, 2026 at 01:59:59PM -0800, Rosen Penev wrote:
> Remove some unused includes that are not used directly.
>
> While at it:
> - use devm_kzalloc_obj() for the chip allocation
> - rename the platform_device from ofdev to the conventional pdev
> - compact the OF match table
> - move module_platform_driver() next to the driver struct
>
> No functional change.
>
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> drivers/gpio/gpio-ppc44x.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpio/gpio-ppc44x.c b/drivers/gpio/gpio-ppc44x.c
> index 8b9ea00f170c..04653e753d43 100644
> --- a/drivers/gpio/gpio-ppc44x.c
> +++ b/drivers/gpio/gpio-ppc44x.c
> @@ -10,13 +10,8 @@
> */
>
> #include <linux/bits.h>
> -#include <linux/kernel.h>
> -#include <linux/init.h>
> #include <linux/io.h>
> -#include <linux/of.h>
> #include <linux/gpio/generic.h>
> -#include <linux/types.h>
> -#include <linux/slab.h>
> #include <linux/platform_device.h>
>
> /* Pins are numbered from the MSB; the select registers use 2 bits per pin */
> @@ -139,20 +134,20 @@ ppc44x_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
> return 0;
> }
>
> -static int ppc44x_gpio_probe(struct platform_device *ofdev)
> +static int ppc44x_gpio_probe(struct platform_device *pdev)
> {
> - struct device *dev = &ofdev->dev;
> + struct device *dev = &pdev->dev;
> struct ppc44x_gpio __iomem *regs;
> struct ppc44x_gpio_chip *chip;
> struct gpio_generic_chip_config config;
> struct gpio_chip *gc;
> int ret;
>
> - regs = devm_platform_ioremap_resource(ofdev, 0);
> + regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(regs))
> return PTR_ERR(regs);
>
> - chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
> + chip = devm_kzalloc_obj(dev, *chip);
> if (!chip)
> return -ENOMEM;
>
> @@ -180,9 +175,7 @@ static int ppc44x_gpio_probe(struct platform_device *ofdev)
> }
>
> static const struct of_device_id ppc44x_gpio_match[] = {
> - {
> - .compatible = "ibm,ppc4xx-gpio",
> - },
> + { .compatible = "ibm,ppc4xx-gpio" },
> {},

Uwe: is this in line with your recent cleanups?

Bart