From a1383655cfaa71609d6236ae0fcf3b6047462b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 29 Feb 2020 09:25:20 +0100 Subject: bcm27xx: add linux 5.4 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested on bcm2710 (Raspberry Pi 3B). Signed-off-by: Álvaro Fernández Rojas --- ...-rpivid-Clean-up-error-handling-use-of-ER.patch | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.4/950-0399-driver-char-rpivid-Clean-up-error-handling-use-of-ER.patch (limited to 'target/linux/bcm27xx/patches-5.4/950-0399-driver-char-rpivid-Clean-up-error-handling-use-of-ER.patch') diff --git a/target/linux/bcm27xx/patches-5.4/950-0399-driver-char-rpivid-Clean-up-error-handling-use-of-ER.patch b/target/linux/bcm27xx/patches-5.4/950-0399-driver-char-rpivid-Clean-up-error-handling-use-of-ER.patch new file mode 100644 index 0000000000..b61e2c5cfe --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0399-driver-char-rpivid-Clean-up-error-handling-use-of-ER.patch @@ -0,0 +1,62 @@ +From 8b95d0d18fcfb940fb0d171663ce5c93b8fb0024 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 21 Jan 2020 16:24:45 +0000 +Subject: [PATCH] driver: char: rpivid: Clean up error handling use of + ERR_PTR/IS_ERR + +The driver used an unnecessary intermediate void* variable so it +only called ERR_PTR once to convert to the error value. + +Switch to converting as the error arises to remove these intermediate +variables. + +Signed-off-by: Dave Stevenson +--- + drivers/char/broadcom/rpivid-mem.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +--- a/drivers/char/broadcom/rpivid-mem.c ++++ b/drivers/char/broadcom/rpivid-mem.c +@@ -130,10 +130,8 @@ static const struct of_device_id rpivid_ + static int rpivid_mem_probe(struct platform_device *pdev) + { + int err; +- void *ptr_err; + const struct of_device_id *id; + struct device *dev = &pdev->dev; +- struct device *rpivid_mem_dev; + struct resource *ioresource; + struct rpivid_mem_priv *priv; + +@@ -183,16 +181,16 @@ static int rpivid_mem_probe(struct platf + /* Create sysfs entries */ + + priv->class = class_create(THIS_MODULE, priv->name); +- ptr_err = priv->class; +- if (IS_ERR(ptr_err)) ++ if (IS_ERR(priv->class)) { ++ err = PTR_ERR(priv->class); + goto failed_class_create; ++ } + +- rpivid_mem_dev = device_create(priv->class, NULL, +- priv->devid, NULL, +- priv->name); +- ptr_err = rpivid_mem_dev; +- if (IS_ERR(ptr_err)) ++ dev = device_create(priv->class, NULL, priv->devid, NULL, priv->name); ++ if (IS_ERR(dev)) { ++ err = PTR_ERR(dev); + goto failed_device_create; ++ } + + /* Legacy alias */ + { +@@ -217,7 +215,6 @@ failed_device_create: + class_destroy(priv->class); + failed_class_create: + cdev_del(&priv->rpivid_mem_cdev); +- err = PTR_ERR(ptr_err); + failed_cdev_add: + unregister_chrdev_region(priv->devid, 1); + failed_alloc_chrdev: -- cgit v1.2.3