[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKDJKT4D7VV1pxC1Bme5wptEW=2uyWBccVCv06tTwgrW20diVA@mail.gmail.com>
Date: Thu, 19 Sep 2013 19:26:41 +0530
From: Manish Badarkhe <badarkhe.manish@...il.com>
To: Rhyland Klein <rklein@...dia.com>
Cc: Anton Vorontsov <anton@...msg.org>,
David Woodhouse <dwmw2@...radead.org>,
Darbha Sriharsha <dsriharsha@...dia.com>,
devicetree@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-tegra@...r.kernel.org
Subject: Re: [PATCH] drivers: power: Add support for bq24735 charger
Hi
> + ret = gpio_request(charger_device->pdata->status_gpio, name);
> + if (ret) {
> + dev_err(&client->dev, "Failed gpio request: %d\n", ret);
> + goto err_free_name;
> + }
> + }
snip ...
> +err_free_name:
> + if (name && name != charger_device->pdata->name)
> + kfree(name);
> +
> + return ret;
> +}
Like to know, Is there a need to free gpio which has been requested previously?
Alternatively, this can be get requested using "devm_" function so
that it will get
freed automatically during removal.
> +static int bq24735_charger_remove(struct i2c_client *client)
> +{
> + struct bq24735_charger *charger_device = i2c_get_clientdata(client);
> +
> + if (charger_device->irq)
> + devm_free_irq(charger_device->dev, charger_device->irq,
> + &charger_device->charger);
> +
> + power_supply_unregister(&charger_device->charger);
> +
> + if (charger_device->charger.name != charger_device->pdata->name)
> + kfree(charger_device->charger.name);
> +
> + return 0;
Ditto, If go with free_gpio.
Regards
Manish Badarkhe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists