diff mbox

gpio/gpio-omap: Use existing pointer to struct device

Message ID 1349429858-17943-1-git-send-email-tklauser@distanz.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Tobias Klauser Oct. 5, 2012, 9:37 a.m. UTC
A pointer to "pdev->dev" is already stored in "dev", so use it in
devm_kzalloc.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/gpio/gpio-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Kevin Hilman Oct. 5, 2012, 7:05 p.m. UTC | #1
Tobias Klauser <tklauser@distanz.ch> writes:

> A pointer to "pdev->dev" is already stored in "dev", so use it in
> devm_kzalloc.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Acked-by: Kevin Hilman <khilman@ti.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Oct. 8, 2012, 6:55 p.m. UTC | #2
On Fri, Oct 5, 2012 at 11:37 AM, Tobias Klauser <tklauser@distanz.ch> wrote:

> A pointer to "pdev->dev" is already stored in "dev", so use it in
> devm_kzalloc.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied with Kevin's ACK, thanks!

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 94cbc84..eb73dee 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1070,7 +1070,7 @@  static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -EINVAL;
 
-	bank = devm_kzalloc(&pdev->dev, sizeof(struct gpio_bank), GFP_KERNEL);
+	bank = devm_kzalloc(dev, sizeof(struct gpio_bank), GFP_KERNEL);
 	if (!bank) {
 		dev_err(dev, "Memory alloc failed\n");
 		return -ENOMEM;