[PATCH] gpio: ucb1400: Remove platform setup and teardown support

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Jun 14 22:43:01 PDT 2022


Hello,

[Cc += pxa maintainers and a few people I talked to about this driver in
irc yesterday]

On Tue, Jun 14, 2022 at 09:48:02PM +0200, Uwe Kleine-König wrote:
> There is no user of these callbacks. The motivation for this change is
> to stop returning an error code from the remove callback.
> 
> This is a preparation for making platform remove callbacks return void.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

A side note to this driver:

In the probe routine there is a check at the start:

	struct ucb1400_gpio *ucb = dev_get_platdata(&dev->dev);

        if (!(ucb && ucb->gpio_offset)) {
                err = -EINVAL;
                goto err;
        }

So the driver doesn't bind unless there is platdata and it has
gpio_offset != 0. (The decade before last called and wants its fixed
gpio numbers back :-)

platdata is assembled in drivers/mfd/ucb1400_core.c:ucb1400_core_probe()
using:

	struct ucb1400_pdata *pdata = dev_get_platdata(dev);
	...
	if (pdata)
		ucb_gpio.gpio_offset = pdata->gpio_offset;

All machines using this ucb1400 mfd (i.e. arch/arm/mach-pxa/balloon3.c,
arch/arm/mach-pxa/colibri-pxa270.c, arch/arm/mach-pxa/vpac270.c) all
don't set the .gpio_offset member in their ucb1400_pdata.

So the gpio driver is effectively unused and alternatively could just be
removed entirely. Also there seems to be some pending spring cleanup, so
the pxa boards might just be removed soon, which looks like a good
opportunity to drop the driver, too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220615/8ff491ce/attachment.sig>


More information about the linux-arm-kernel mailing list