Re: [PATCH] mmc: atmel-mci: Convert to gpio descriptors

From: Linus Walleij
Date: Wed Nov 09 2022 - 09:48:55 EST


On Wed, Nov 9, 2022 at 1:39 PM Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote:
> On Wed, 9 Nov 2022 at 05:39, Balamanikandan Gunasundar
(...)
> > --- a/drivers/mmc/host/atmel-mci.c
> > +++ b/drivers/mmc/host/atmel-mci.c
> > @@ -19,7 +19,8 @@
> > #include <linux/module.h>
> > #include <linux/of.h>
> > #include <linux/of_device.h>
> > -#include <linux/of_gpio.h>
> > +#include <linux/irq.h>
> > +#include <linux/gpio/consumer.h>

This is nice, but higher up the driver also #include <linux/gpio.h>
so delete that line too, <linux/gpio/consumer.h> should be enough.

> > - of_get_named_gpio(cnp, "cd-gpios", 0);
> > + devm_gpiod_get_from_of_node(&pdev->dev, cnp,
> > + "cd-gpios",
> > + 0, GPIOD_IN, "cd-gpios");
(...)
> > pdata->slot[slot_id].wp_pin =
> > - of_get_named_gpio(cnp, "wp-gpios", 0);
> > + devm_gpiod_get_from_of_node(&pdev->dev, cnp,
> > + "wp-gpios",
> > + 0, GPIOD_IN, "wp-gpios");

Hm. Dmitry is trying to get rid of of_get_named_gpio() I think.

But I suppose we can migrate to fwnode later.

This is at least better than before so go with this for now.

Yours,
Linus Walleij