gpio: adp5520: use devm_kzalloc()
PATCH 1/6 gpio: adp5520: use devm_kzalloc()
Use devm_kzalloc() to make cleanup paths simpler.
--- drivers/gpio/gpio-adp5520.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/gpio/gpio-adp5520.c +1 -3
@@ -105,7 +105,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)return -ENODEV ; } - dev =kzalloc (sizeof (*dev),GFP_KERNEL ); + dev =devm_kzalloc (&pdev->dev,sizeof (*dev),GFP_KERNEL );if (dev ==NULL ) {dev_err (&pdev->dev,"failed to alloc memory\n" );return -ENOMEM ;
@@ -163,7 +163,6 @@ static int adp5520_gpio_probe(struct platform_device *pdev)return 0 ; err: -kfree (dev);return ret; }
@@ -180,7 +179,6 @@ static int adp5520_gpio_remove(struct platform_device *pdev)return ret; } -kfree (dev);return 0 ; }
Signature · 1 line
1.7.2.5
PATCH 2/6 gpio: max7300: use devm_kzalloc()
Use devm_kzalloc() to make cleanup paths simpler.
--- drivers/gpio/gpio-max7300.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/gpio/gpio-max7300.c +1 -3
@@ -41,7 +41,7 @@ static int max7300_probe(struct i2c_client *client, I2C_FUNC_SMBUS_BYTE_DATA))return -EIO ; - ts =kzalloc (sizeof (struct max7301 ),GFP_KERNEL ); + ts =devm_kzalloc (&client->dev,sizeof (struct max7301 ),GFP_KERNEL );if (!ts)return -ENOMEM ;
@@ -50,8 +50,6 @@ static int max7300_probe(struct i2c_client *client, ts->dev = &client->dev; ret =__max730x_probe (ts); -if (ret) -kfree (ts);return ret; }
Signature · 1 line
1.7.2.5
Re: [PATCH 2/6] gpio: max7300: use devm_kzalloc()
Quoted 3 lines · Jingoo Han
Use
devm_kzalloc()to make cleanup paths simpler.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij
PATCH 3/6 gpio: max7301: use devm_kzalloc()
In reply to Jingoo HanUse devm_kzalloc() to make cleanup paths simpler.
--- drivers/gpio/gpio-max7301.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/gpio/gpio-max7301.c +1 -3
@@ -61,7 +61,7 @@ static int max7301_probe(struct spi_device *spi)if (ret <0 )return ret; - ts =kzalloc (sizeof (struct max7301 ),GFP_KERNEL ); + ts =devm_kzalloc (&spi->dev,sizeof (struct max7301 ),GFP_KERNEL );if (!ts)return -ENOMEM ;
@@ -70,8 +70,6 @@ static int max7301_probe(struct spi_device *spi) ts->dev = &spi->dev; ret =__max730x_probe (ts); -if (ret) -kfree (ts);return ret; }
Signature · 1 line
1.7.2.5
Re: [PATCH 3/6] gpio: max7301: use devm_kzalloc()
Quoted 3 lines · Jingoo Han
Use
devm_kzalloc()to make cleanup paths simpler.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij
PATCH 4/6 gpio: max732x: use devm_kzalloc()
In reply to Jingoo HanUse devm_kzalloc() to make cleanup paths simpler.
--- drivers/gpio/gpio-max732x.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpio/gpio-max732x.c +2 -3
@@ -589,7 +589,8 @@ static int max732x_probe(struct i2c_client *client,return -EINVAL ; } - chip =kzalloc (sizeof (struct max732x_chip ),GFP_KERNEL ); + chip =devm_kzalloc (&client->dev,sizeof (struct max732x_chip ), +GFP_KERNEL );if (chip ==NULL )return -ENOMEM ; chip->client = client;
@@ -647,7 +648,6 @@ static int max732x_probe(struct i2c_client *client, out_failed:max732x_irq_teardown (chip); -kfree (chip);return ret; }
@@ -680,7 +680,6 @@ static int max732x_remove(struct i2c_client *client)if (chip->client_dummy)i2c_unregister_device (chip->client_dummy); -kfree (chip);return 0 ; }
Signature · 1 line
1.7.2.5
Re: [PATCH 4/6] gpio: max732x: use devm_kzalloc()
Quoted 3 lines · Jingoo Han
Use
devm_kzalloc()to make cleanup paths simpler.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij
PATCH 5/6 gpio: mc33880: use devm_kzalloc()
In reply to Jingoo HanUse devm_kzalloc() to make cleanup paths simpler.
--- drivers/gpio/gpio-mc33880.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/gpio/gpio-mc33880.c +3 -5
@@ -101,7 +101,7 @@ static int mc33880_probe(struct spi_device *spi)if (ret <0 )return ret; - mc =kzalloc (sizeof (struct mc33880 ),GFP_KERNEL ); + mc =devm_kzalloc (&spi->dev,sizeof (struct mc33880 ),GFP_KERNEL );if (!mc)return -ENOMEM ;
@@ -143,7 +143,6 @@ static int mc33880_probe(struct spi_device *spi) exit_destroy:dev_set_drvdata (&spi->dev,NULL );mutex_destroy (&mc->lock); -kfree (mc);return ret; }
@@ -159,10 +158,9 @@ static int mc33880_remove(struct spi_device *spi)dev_set_drvdata (&spi->dev,NULL ); ret =gpiochip_remove (&mc->chip); -if (!ret) { +if (!ret)mutex_destroy (&mc->lock); -kfree (mc); - }else +else dev_err (&spi->dev,"Failed to remove the GPIO controller: %d\n" , ret);
Signature · 1 line
1.7.2.5
Re: [PATCH 5/6] gpio: mc33880: use devm_kzalloc()
Quoted 3 lines · Jingoo Han
Use
devm_kzalloc()to make cleanup paths simpler.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij
PATCH 6/6 gpio: pcf857x: use devm_kzalloc()
In reply to Jingoo HanUse devm_kzalloc() to make cleanup paths simpler.
--- drivers/gpio/gpio-pcf857x.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-pcf857x.c +2 -5
@@ -267,7 +267,7 @@ static int pcf857x_probe(struct i2c_client *client, }/* Allocate, initialize, and register this gpio_chip. */ - gpio =kzalloc (sizeof *gpio,GFP_KERNEL ); + gpio =devm_kzalloc (&client->dev,sizeof (*gpio),GFP_KERNEL );if (!gpio)return -ENOMEM ;
@@ -390,7 +390,6 @@ fail:if (pdata && client->irq)pcf857x_irq_domain_cleanup (gpio); -kfree (gpio);return status; }
@@ -415,9 +414,7 @@ static int pcf857x_remove(struct i2c_client *client)pcf857x_irq_domain_cleanup (gpio); status =gpiochip_remove (&gpio->chip); -if (status ==0 ) -kfree (gpio); -else +if (status)dev_err (&client->dev,"%s --> %d\n" ,"remove" , status);return status; }
Signature · 1 line
1.7.2.5
Re: [PATCH 6/6] gpio: pcf857x: use devm_kzalloc()
Quoted 3 lines · Jingoo Han
Use
devm_kzalloc()to make cleanup paths simpler.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij
Quoted 3 lines · Jingoo Han
Use
devm_kzalloc()to make cleanup paths simpler.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij