Skip to contentSkip to conversation

drm/panfrost: simplify the return expression of cz_ih_hw_init()

PATCH In review Qinglang Miao 3 participants 3 messages Sep 21, 2020 – Oct 1, 2020

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

PATCH 1/1 drm/panfrost: simplify the return expression of cz_ih_hw_init()

Simplify the return expression.

---
 drivers/gpu/drm/panfrost/panfrost_device.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/panfrost/panfrost_device.c +1 -7
index e68967338..ea8d31863 100644
@@ -18,19 +18,13 @@
 
 static int panfrost_reset_init(struct panfrost_device *pfdev)
 {
-	int err;
-
 	pfdev->rstc = devm_reset_control_array_get(pfdev->dev, false, true);
 	if (IS_ERR(pfdev->rstc)) {
 		dev_err(pfdev->dev, "get reset failed %ld\n", PTR_ERR(pfdev->rstc));
 		return PTR_ERR(pfdev->rstc);
 	}
 
-	err = reset_control_deassert(pfdev->rstc);
-	if (err)
-		return err;
-
-	return 0;
+	return reset_control_deassert(pfdev->rstc);
 }
 
 static void panfrost_reset_fini(struct panfrost_device *pfdev)
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Qinglang Miao

Simplify the return expression.

---
 drivers/gpu/drm/panfrost/panfrost_device.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/panfrost/panfrost_device.c +0 -2
index e68967338..ea8d31863 100644
@@ -18,19 +18,13 @@
 
 static int panfrost_reset_init(struct panfrost_device *pfdev)
 {
-	int err;
-
 	pfdev->rstc = devm_reset_control_array_get(pfdev->dev, false, true);
 	if (IS_ERR(pfdev->rstc)) {
 		dev_err(pfdev->dev, "get reset failed %ld\n", PTR_ERR(pfdev->rstc));
 		return PTR_ERR(pfdev->rstc);
 	}

drivers/gpu/drm/panfrost/panfrost_device.c line 30

Quoted 10 lines
drivers/gpu/drm/panfrost/panfrost_device.c +1 -5
 
-	err = reset_control_deassert(pfdev->rstc);
-	if (err)
-		return err;
-
-	return 0;
+	return reset_control_deassert(pfdev->rstc);
 }
 
 static void panfrost_reset_fini(struct panfrost_device *pfdev)

regards
Philipp
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Qinglang Miao
Quoted 3 lines · Qinglang Miao

Simplify the return expression.

Quoted 30 lines
---
  drivers/gpu/drm/panfrost/panfrost_device.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/panfrost/panfrost_device.c +1 -7
index e68967338..ea8d31863 100644
@@ -18,19 +18,13 @@
 
  static int panfrost_reset_init(struct panfrost_device *pfdev)
  {
-	int err;
-
  	pfdev->rstc = devm_reset_control_array_get(pfdev->dev, false, true);
  	if (IS_ERR(pfdev->rstc)) {
  		dev_err(pfdev->dev, "get reset failed %ld\n", PTR_ERR(pfdev->rstc));
  		return PTR_ERR(pfdev->rstc);
  	}
 
-	err = reset_control_deassert(pfdev->rstc);
-	if (err)
-		return err;
-
-	return 0;
+	return reset_control_deassert(pfdev->rstc);
  }
 
  static void panfrost_reset_fini(struct panfrost_device *pfdev)