Skip to contentSkip to conversation

drivers: rtc: pcf8536: Remove redundant variable

PATCH Applied Alexander Shiyan 2 participants 7 messages Jun 29, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 drivers: rtc: pcf8536: Remove redundant variable

---
 drivers/rtc/rtc-pcf85363.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/rtc/rtc-pcf85363.c +1 -4
index 7b785d6a77..b9f0fc6012 100644
@@ -131,7 +131,6 @@ static int pcf85363_probe(struct device_d *dev)
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pcf85363 *pcf85363;
 	struct regmap *regmap;
-	int ret;
 
 	regmap = regmap_init_i2c(client,
 				&pcf85363_regmap_i2c_config);
@@ -147,9 +146,7 @@ static int pcf85363_probe(struct device_d *dev)
 	pcf85363->rtc.ops = &rtc_ops;
 	pcf85363->rtc.dev = dev;
 
-	ret = rtc_register(&pcf85363->rtc);
-
-	return ret;
+	return rtc_register(&pcf85363->rtc);
 }
 
 static struct platform_device_id dev_ids[] = {
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/6 drivers: rtc: abracon: Remove redundant variable

---
 drivers/rtc/rtc-abracon.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/rtc/rtc-abracon.c +1 -4
index 6144fc0aa9..585b95c4a7 100644
@@ -84,7 +84,6 @@ static int abracon_probe(struct device_d *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct abracon *abracon;
-	int ret;
 
 	abracon = xzalloc(sizeof(*abracon));
 
@@ -93,9 +92,7 @@ static int abracon_probe(struct device_d *dev)
 	abracon->rtc.ops = &ds13xx_rtc_ops;
 	abracon->rtc.dev = dev;
 
-	ret = rtc_register(&abracon->rtc);
-
-	return ret;
+	return rtc_register(&abracon->rtc);
 };
 
 static struct platform_device_id abracon_id[] = {
Signature · 1 line
2.32.0
#2 lore raw

PATCH 3/6 drivers: regulator: fixed: Fix error path in probe

In reply to Alexander Shiyan
---
 drivers/regulator/fixed.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/regulator/fixed.c +2 -3
index f068fded62..ddcc1bcb97 100644
@@ -78,10 +78,9 @@ static int regulator_fixed_probe(struct device_d *dev)
 	}
 
 	ret = of_regulator_register(&fix->rdev, dev->device_node);
-	if (ret)
-		return ret;
+	if (!ret)
+		return 0;
 
-	return 0;
 err:
 	free(fix);
 
Signature · 1 line
2.32.0
#3 lore raw

PATCH 4/6 drivers: pwm: imx: Remove redundant assignment

In reply to Alexander Shiyan
---
 drivers/pwm/pwm-imx.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/pwm/pwm-imx.c +2 -6
index 609765d895..c542b72796 100644
@@ -206,7 +206,7 @@ static int imx_pwm_probe(struct device_d *dev)
 	struct resource *iores;
 	const struct imx_pwm_data *data;
 	struct imx_chip *imx;
-	int ret = 0;
+	int ret;
 
 	ret = dev_get_drvdata(dev, (const void **)&data);
 	if (ret)
@@ -236,11 +236,7 @@ static int imx_pwm_probe(struct device_d *dev)
 	imx->config = data->config;
 	imx->set_enable = data->set_enable;
 
-	ret = pwmchip_add(&imx->chip, dev);
-	if (ret < 0)
-		return ret;
-
-	return 0;
+	return pwmchip_add(&imx->chip, dev);;
 }
 
 static struct driver_d imx_pwm_driver = {
Signature · 1 line
2.32.0
#4 lore raw

PATCH 5/6 drivers: gpio: pcf857x: Remove redundant assignment

In reply to Alexander Shiyan
---
 drivers/gpio/gpio-pcf857x.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpio/gpio-pcf857x.c +1 -5
index fefd20de6f..612ef3a82e 100644
@@ -219,11 +219,7 @@ static int pcf857x_probe(struct device_d *dev)
 	 */
 	gpio->out = ~n_latch;
 
-	ret = gpiochip_add(&gpio->chip);
-	if (ret)
-		return ret;
-
-	return ret;
+	return gpiochip_add(&gpio->chip);
 }
 
 static const struct of_device_id pcf857x_dt_ids[] = {
Signature · 1 line
2.32.0
#5 lore raw

PATCH 6/6 drivers: led: pca955x: Remove redundant assignment

In reply to Alexander Shiyan
---
 drivers/led/led-pca955x.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/led/led-pca955x.c +2 -3
index 848feb9773..aa518fe738 100644
@@ -387,11 +387,10 @@ static int led_pca955x_probe(struct device_d *dev)
 	err = pca955x_write_psc(client, 0, 0);
 	if (err)
 		return err;
+
 	err = pca955x_write_psc(client, 1, 0);
-	if (err)
-		return err;
 
-	return 0;
+	return err;
 }
 
 static struct driver_d led_pca955x_driver = {
Signature · 1 line
2.32.0
Applied
#6 lore raw
In reply to Alexander Shiyan
Quoted 4 lines · Alexander Shiyan
---
 drivers/rtc/rtc-pcf85363.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Applied, thanks

Sascha

Quoted 29 lines
drivers/rtc/rtc-pcf85363.c +1 -4
index 7b785d6a77..b9f0fc6012 100644
@@ -131,7 +131,6 @@ static int pcf85363_probe(struct device_d *dev)
 	struct i2c_client *client = to_i2c_client(dev);
 	struct pcf85363 *pcf85363;
 	struct regmap *regmap;
-	int ret;
 
 	regmap = regmap_init_i2c(client,
 				&pcf85363_regmap_i2c_config);
@@ -147,9 +146,7 @@ static int pcf85363_probe(struct device_d *dev)
 	pcf85363->rtc.ops = &rtc_ops;
 	pcf85363->rtc.dev = dev;
 
-	ret = rtc_register(&pcf85363->rtc);
-
-	return ret;
+	return rtc_register(&pcf85363->rtc);
 }
 
 static struct platform_device_id dev_ids[] = {
Signature · 1 line
2.32.0
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |