Input: adc-joystick - Switch to use dev_err_probe() helper
Subsystems (2)
PATCH 1/4 Input: adc-joystick - Switch to use dev_err_probe() helper
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.
--- drivers/input/joystick/adc-joystick.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/input/joystick/adc-joystick.c +3 -6
@@ -201,12 +201,9 @@ static int adc_joystick_probe(struct platform_device *pdev)return -ENOMEM ; joy->chans =devm_iio_channel_get_all (dev); -if (IS_ERR (joy->chans)) { - error =PTR_ERR (joy->chans); -if (error != -EPROBE_DEFER ) -dev_err (dev,"Unable to get IIO channels" ); -return error; - } +if (IS_ERR (joy->chans)) +return dev_err_probe (dev,PTR_ERR (joy->chans), +"Unable to get IIO channels\n" ); error =device_property_read_u32 (dev,"poll-interval" , &poll_interval);if (error) {
Signature · 1 line
2.25.1
PATCH 2/4 Input: bcm-keypad - Switch to use dev_err_probe() helper
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.
--- drivers/input/keyboard/bcm-keypad.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/keyboard/bcm-keypad.c +3 -5
@@ -368,11 +368,9 @@ static int bcm_kp_probe(struct platform_device *pdev) kp->clk =devm_clk_get (&pdev->dev,"peri_clk" );if (IS_ERR (kp->clk)) { error =PTR_ERR (kp->clk); -if (error != -ENOENT ) { -if (error != -EPROBE_DEFER ) -dev_err (&pdev->dev,"Failed to get clock\n" ); -return error; - } +if (error != -ENOENT ) +return dev_err_probe (&pdev->dev, error, +"Failed to get clock\n" );dev_dbg (&pdev->dev,"No clock specified. Assuming it's enabled\n" ); kp->clk =NULL ;
Signature · 1 line
2.25.1
Re: [PATCH -next 2/4] Input: bcm-keypad - Switch to use dev_err_probe() helper
Hi Yang,
Thank you for your patch,
Quoted 16 lines · Yang Yingliang
In the probe path,
dev_err()can be replaced withdev_err_probe()which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.Signed-off-by Yang Yingliang <[email protected]>--- drivers/input/keyboard/bcm-keypad.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/input/keyboard/bcm-keypad.c +0
-0@@ -368,11 +368,9 @@ static int bcm_kp_probe(struct platform_device *pdev) kp->clk =devm_clk_get (&pdev->dev,"peri_clk" );
drivers/input/keyboard/bcm-keypad.c static int bcm_kp_probe(struct platform_device *pdev) · line 373
Quoted 10 lines
drivers/input/keyboard/bcm-keypad.c +3
-5if (IS_ERR (kp->clk)) { error =PTR_ERR (kp->clk); -if (error != -ENOENT ) { -if (error != -EPROBE_DEFER ) -dev_err (&pdev->dev,"Failed to get clock\n" ); -return error; - } +if (error != -ENOENT ) +return dev_err_probe (&pdev->dev, error, +"Failed to get clock\n" );
If we look at the input tree, we can see that there is no occurence of dev_err_probe():
$ ~/src/linux/drivers/input/ 483fed3b5dc8 grep -rsn dev_err_probe $ ~/src/linux/drivers/input/ 483fed3b5dc8
The reason for this is that the input maintainer (Dmitry) dislikes dev_err_probe() as he stated in [1]
So I don't think he will apply this.
Regards,
Mattijs
Quoted 5 lines
drivers/input/keyboard/bcm-keypad.c +0
-0dev_dbg (&pdev->dev,"No clock specified. Assuming it's enabled\n" ); kp->clk =NULL ;Signature · 1 line
2.25.1
PATCH 3/4 Input: gpio_keys - Switch to use dev_err_probe() helper
In reply to Yang YingliangIn the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.
--- drivers/input/keyboard/gpio_keys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/input/keyboard/gpio_keys.c +2 -4
@@ -530,10 +530,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,*/ bdata->gpiod =NULL ; }else { -if (error != -EPROBE_DEFER ) -dev_err (dev,"failed to get gpio: %d\n" , - error); -return error; +return dev_err_probe (dev, error, +"failed to get gpio\n" ); } } }else if (gpio_is_valid (button->gpio)) {
Signature · 1 line
2.25.1
Re: [PATCH -next 3/4] Input: gpio_keys - Switch to use dev_err_probe() helper
Hi Yang,
Thank you for your patch,
Quoted 15 lines · Yang Yingliang
In the probe path,
dev_err()can be replaced withdev_err_probe()which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.Signed-off-by Yang Yingliang <[email protected]>--- drivers/input/keyboard/gpio_keys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/input/keyboard/gpio_keys.c +0
-0
drivers/input/keyboard/gpio_keys.c static int gpio_keys_setup_key(struct platform_device *pdev, · line 534
Quoted 9 lines
drivers/input/keyboard/gpio_keys.c +2
-4@@ -530,10 +530,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,*/ bdata->gpiod =NULL ; }else { -if (error != -EPROBE_DEFER ) -dev_err (dev,"failed to get gpio: %d\n" , - error); -return error; +return dev_err_probe (dev, error, +"failed to get gpio\n" );
If we look at the input tree, we can see that there is no occurence of dev_err_probe():
$ ~/src/linux/drivers/input/ 483fed3b5dc8 grep -rsn dev_err_probe $ ~/src/linux/drivers/input/ 483fed3b5dc8
The reason for this is that the input maintainer (Dmitry) dislikes dev_err_probe() as he stated in [1]
So I don't think he will apply this.
Regards,
Mattijs
Quoted 5 lines
drivers/input/keyboard/gpio_keys.c +0
-0} } }else if (gpio_is_valid (button->gpio)) {Signature · 1 line
2.25.1
Re: [PATCH -next 3/4] Input: gpio_keys - Switch to use dev_err_probe() helper
Quoted 37 lines · Mattijs Korpershoek
Hi Yang,
Thank you for your patch,
Quoted 15 lines · Yang Yingliang
In the probe path,
dev_err()can be replaced withdev_err_probe()which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.Signed-off-by Yang Yingliang <[email protected]>--- drivers/input/keyboard/gpio_keys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/input/keyboard/gpio_keys.c +0
-0drivers/input/keyboard/gpio_keys.c static int gpio_keys_setup_key(struct platform_device *pdev, · line 534
Quoted 9 lines
drivers/input/keyboard/gpio_keys.c +2
-4@@ -530,10 +530,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,*/ bdata->gpiod =NULL ; }else { -if (error != -EPROBE_DEFER ) -dev_err (dev,"failed to get gpio: %d\n" , - error); -return error; +return dev_err_probe (dev, error, +"failed to get gpio\n" );If we look at the input tree, we can see that there is no occurence of
dev_err_probe():$ ~/src/linux/drivers/input/ 483fed3b5dc8 grep -rsn dev_err_probe $ ~/src/linux/drivers/input/ 483fed3b5dc8
Quoted 7 lines
The reason for this is that the input maintainer (Dmitry) dislikes
dev_err_probe()as he stated in [1]So I don't think he will apply this.
Regards,
Mattijs
Argh, I missed the link. here it is:
[1] https://lore.kernel.org/r/[email protected]
Quoted 6 lines
Quoted 6 lines
drivers/input/keyboard/gpio_keys.c +0
-0} } }else if (gpio_is_valid (button->gpio)) {Signature · 1 line
2.25.1
PATCH 4/4 Input: gpio_keys_polled - Switch to use dev_err_probe() helper
In reply to Yang YingliangIn the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.
--- drivers/input/keyboard/gpio_keys_polled.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/input/keyboard/gpio_keys_polled.c +2 -6
@@ -299,13 +299,9 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)NULL ,GPIOD_IN , button->desc);if (IS_ERR (bdata->gpiod)) { - error =PTR_ERR (bdata->gpiod); -if (error != -EPROBE_DEFER ) -dev_err (dev, -"failed to get gpio: %d\n" , - error);fwnode_handle_put (child); -return error; +return dev_err_probe (dev,PTR_ERR (bdata->gpiod), +"failed to get gpio\n" ); } }else if (gpio_is_valid (button->gpio)) {/*
Signature · 1 line
2.25.1
Re: [PATCH -next 4/4] Input: gpio_keys_polled - Switch to use dev_err_probe() helper
Hi Yang,
Thank you for your patch,
Quoted 17 lines · Yang Yingliang
In the probe path,
dev_err()can be replaced withdev_err_probe()which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.Signed-off-by Yang Yingliang <[email protected]>--- drivers/input/keyboard/gpio_keys_polled.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/input/keyboard/gpio_keys_polled.c +0
-0@@ -299,13 +299,9 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)NULL ,GPIOD_IN , button->desc);
drivers/input/keyboard/gpio_keys_polled.c static int gpio_keys_polled_probe(struct platform_device *pdev) · line 304
Quoted 10 lines
drivers/input/keyboard/gpio_keys_polled.c +2
-6if (IS_ERR (bdata->gpiod)) { - error =PTR_ERR (bdata->gpiod); -if (error != -EPROBE_DEFER ) -dev_err (dev, -"failed to get gpio: %d\n" , - error);fwnode_handle_put (child); -return error; +return dev_err_probe (dev,PTR_ERR (bdata->gpiod), +"failed to get gpio\n" );
If we look at the input tree, we can see that there is no occurence of dev_err_probe():
$ ~/src/linux/drivers/input/ 483fed3b5dc8 grep -rsn dev_err_probe $ ~/src/linux/drivers/input/ 483fed3b5dc8
The reason for this is that the input maintainer (Dmitry) dislikes dev_err_probe() as he stated in [1]
So I don't think he will apply this.
Regards,
Mattijs
Quoted 5 lines
drivers/input/keyboard/gpio_keys_polled.c +0
-0} }else if (gpio_is_valid (button->gpio)) {/* Signature · 1 line
2.25.1
Re: [PATCH -next 4/4] Input: gpio_keys_polled - Switch to use dev_err_probe() helper
Quoted 40 lines · Mattijs Korpershoek
Hi Yang,
Thank you for your patch,
Quoted 17 lines · Yang Yingliang
In the probe path,
dev_err()can be replaced withdev_err_probe()which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.Signed-off-by Yang Yingliang <[email protected]>--- drivers/input/keyboard/gpio_keys_polled.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/input/keyboard/gpio_keys_polled.c +0
-0@@ -299,13 +299,9 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)NULL ,GPIOD_IN , button->desc);drivers/input/keyboard/gpio_keys_polled.c static int gpio_keys_polled_probe(struct platform_device *pdev) · line 304
Quoted 10 lines
drivers/input/keyboard/gpio_keys_polled.c +2
-6if (IS_ERR (bdata->gpiod)) { - error =PTR_ERR (bdata->gpiod); -if (error != -EPROBE_DEFER ) -dev_err (dev, -"failed to get gpio: %d\n" , - error);fwnode_handle_put (child); -return error; +return dev_err_probe (dev,PTR_ERR (bdata->gpiod), +"failed to get gpio\n" );If we look at the input tree, we can see that there is no occurence of
dev_err_probe():$ ~/src/linux/drivers/input/ 483fed3b5dc8 grep -rsn dev_err_probe $ ~/src/linux/drivers/input/ 483fed3b5dc8
Quoted 7 lines
The reason for this is that the input maintainer (Dmitry) dislikes
dev_err_probe()as he stated in [1]So I don't think he will apply this.
Regards,
Mattijs
Argh, I missed the link. here it is:
[1] https://lore.kernel.org/r/[email protected]
Quoted 6 lines
Quoted 6 lines
drivers/input/keyboard/gpio_keys_polled.c +0
-0} }else if (gpio_is_valid (button->gpio)) {/* Signature · 1 line
2.25.1
Hi Yang,
Thank you for your patch,
Quoted 17 lines · Yang Yingliang
In the probe path,
dev_err()can be replaced withdev_err_probe()which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs.Signed-off-by Yang Yingliang <[email protected]>--- drivers/input/joystick/adc-joystick.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)drivers/input/joystick/adc-joystick.c +0
-0@@ -201,12 +201,9 @@ static int adc_joystick_probe(struct platform_device *pdev)return -ENOMEM ;
drivers/input/joystick/adc-joystick.c static int adc_joystick_probe(struct platform_device *pdev) · line 206
Quoted 10 lines
drivers/input/joystick/adc-joystick.c +3
-6joy->chans =devm_iio_channel_get_all (dev); -if (IS_ERR (joy->chans)) { - error =PTR_ERR (joy->chans); -if (error != -EPROBE_DEFER ) -dev_err (dev,"Unable to get IIO channels" ); -return error; - } +if (IS_ERR (joy->chans)) +return dev_err_probe (dev,PTR_ERR (joy->chans), +"Unable to get IIO channels\n" );
If we look at the input tree, we can see that there is no occurence of dev_err_probe():
$ ~/src/linux/drivers/input/ 483fed3b5dc8 grep -rsn dev_err_probe $ ~/src/linux/drivers/input/ 483fed3b5dc8
The reason for this is that the input maintainer (Dmitry) dislikes dev_err_probe() as he stated in [1]
So I don't think he will apply this.
Regards,
Mattijs
Quoted 5 lines
drivers/input/joystick/adc-joystick.c +0
-0error =device_property_read_u32 (dev,"poll-interval" , &poll_interval);if (error) {Signature · 1 line
2.25.1