iio: adc: mt2701: Remove redundant dev_err call in mt6577_auxadc_probe()
Subsystems (2)
PATCH 1/1 iio: adc: mt2701: Remove redundant dev_err call in mt6577_auxadc_probe()
From: Wei Yongjun <[email protected]>
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message.
--- drivers/iio/adc/mt6577_auxadc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/mt6577_auxadc.c +1 -3
@@ -206,10 +206,8 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); adc_dev->reg_base =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (adc_dev->reg_base)) { -dev_err (&pdev->dev,"failed to get auxadc base address\n" ); +if (IS_ERR (adc_dev->reg_base))return PTR_ERR (adc_dev->reg_base); - } adc_dev->adc_clk =devm_clk_get (&pdev->dev,"main" );if (IS_ERR (adc_dev->adc_clk)) {
Jonathan Cameron
maintainerPATCH 1/1 iio: adc: mt2701: Remove redundant dev_err call in mt6577_auxadc_probe()
Quoted 7 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
There is a error message within
devm_ioremap_resourcealready, so remove thedev_errcall to avoid redundant error message.Signed-off-by Wei Yongjun <[email protected]>
Hi Wei,
I'm not so sure these are actually redundant. Overly verbose perhaps, but they do provide additional information in the log as the devm_ioremap_resource doesn't know 'what' has failed, merely how it has failed.
I'm happy to take these, if the driver author / maintainers agree, but I'm not keen enough to take them without that.
Zhiyong Tao, what do you think on this one?
Jonathan
Quoted 23 lines
--- drivers/iio/adc/mt6577_auxadc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/iio/adc/mt6577_auxadc.c +1
-3@@ -206,10 +206,8 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); adc_dev->reg_base =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (adc_dev->reg_base)) { -dev_err (&pdev->dev,"failed to get auxadc base address\n" ); +if (IS_ERR (adc_dev->reg_base))return PTR_ERR (adc_dev->reg_base); - } adc_dev->adc_clk =devm_clk_get (&pdev->dev,"main" );if (IS_ERR (adc_dev->adc_clk)) {
PATCH 1/1 iio: adc: mt2701: Remove redundant dev_err call in mt6577_auxadc_probe()
Quoted 15 lines · Jonathan Cameron
Quoted 7 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
There is a error message within
devm_ioremap_resourcealready, so remove thedev_errcall to avoid redundant error message.Signed-off-by Wei Yongjun <[email protected]>Hi Wei,
I'm not so sure these are actually redundant. Overly verbose perhaps, but they do provide additional information in the log as the
devm_ioremap_resourcedoesn't know 'what' has failed, merely how it has failed.
Quoted 6 lines
I'm happy to take these, if the driver author / maintainers agree, but I'm not keen enough to take them without that.
Zhiyong Tao, what do you think on this one?
Jonathan
Dear Jonathan,
Thank you for your suggestion. I think that we can know 'what' has failed in the driver, if we retain the error message log. It maybe advantageous to debug issues.
Zhiyong
Quoted 24 lines
Quoted 23 lines
--- drivers/iio/adc/mt6577_auxadc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/iio/adc/mt6577_auxadc.c +1
-3@@ -206,10 +206,8 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); adc_dev->reg_base =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (adc_dev->reg_base)) { -dev_err (&pdev->dev,"failed to get auxadc base address\n" ); +if (IS_ERR (adc_dev->reg_base))return PTR_ERR (adc_dev->reg_base); - } adc_dev->adc_clk =devm_clk_get (&pdev->dev,"main" );if (IS_ERR (adc_dev->adc_clk)) {