Thread (2 messages) 2 messages, 2 authors, 2015-01-23

Re: [PATCH V4 4/4] mmc: pwrseq_simple: Add support for a reset GPIO pin

From: Ulf Hansson <hidden>
Date: 2015-01-23 17:01:32
Also in: linux-arm-kernel, linux-mmc

On 23 January 2015 at 16:56, Javier Martinez Canillas
[off-list ref] wrote:
Hello Ulf,

On Mon, Jan 19, 2015 at 10:13 AM, Ulf Hansson [off-list ref] wrote:
quoted
 int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev)
 {
        struct mmc_pwrseq_simple *pwrseq;
+       int ret = 0;

        pwrseq = kzalloc(sizeof(struct mmc_pwrseq_simple), GFP_KERNEL);
        if (!pwrseq)
                return -ENOMEM;

+       pwrseq->reset_gpio = gpiod_get_index(dev, "reset", 0, GPIOD_OUT_HIGH);
Any reason to not use the devm_gpiod_get_index() managed version instead?
This struct device don't have a bound driver to it. Thus this device
won't be freed automagically from the ->remove() or failed ->probe()
path.
AFAICT mmc_free_host() will free the device so in that case you won't
need to call gpiod_put() in mmc_pwrseq_simple_free().

This will also make easier to extend pwrseq_simple to support multiple
GPIOs like the DT binding implies.
Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help