diff mbox

[1/4] media: pci: netup_unidvb: don't print error when adding adapter fails

Message ID 1470742517-12774-2-git-send-email-wsa-dev@sang-engineering.com
State Awaiting Upstream
Headers show

Commit Message

Wolfram Sang Aug. 9, 2016, 11:35 a.m. UTC
The core will do this for us now.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
---
 drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Wolfram Sang Aug. 9, 2016, 2:58 p.m. UTC | #1
> Sometimes it better to show more message - especially in error conditions :)

Sure, if they contain additional information.

> btw, do you make sanity check for "duplicate" log messages ?

I checked all error messages if they contain additional information.

>             ret = i2c_add_adapter(&i2c->adap);
>     -       if (ret) {
>     -               dev_err(&ndev->pci_dev->dev,
>     -                       "%s(): failed to add I2C adapter\n", __func__);
>     +       if (ret)
>                     return ret;
>     -       }

IMHO, this one doesn't. __func__ is not helpful to users. And the error
messages in the core will make sure that a developer knows where to
start looking.
Abylay Ospan Aug. 10, 2016, 2:41 p.m. UTC | #2
yes, you right. If we remove this message there is no big problem. But
if we do not remove this it's also ok, right ? What the big deal to
remove this type of messages (i'm just interested) ?


For me it's ok to remove:
Acked-by: Abylay Ospan <aospan@netup.ru>


2016-08-09 10:58 GMT-04:00 Wolfram Sang <wsa@the-dreams.de>:
>
>> Sometimes it better to show more message - especially in error conditions :)
>
> Sure, if they contain additional information.
>
>> btw, do you make sanity check for "duplicate" log messages ?
>
> I checked all error messages if they contain additional information.
>
>>             ret = i2c_add_adapter(&i2c->adap);
>>     -       if (ret) {
>>     -               dev_err(&ndev->pci_dev->dev,
>>     -                       "%s(): failed to add I2C adapter\n", __func__);
>>     +       if (ret)
>>                     return ret;
>>     -       }
>
> IMHO, this one doesn't. __func__ is not helpful to users. And the error
> messages in the core will make sure that a developer knows where to
> start looking.
>
Wolfram Sang Aug. 10, 2016, 2:56 p.m. UTC | #3
> if we do not remove this it's also ok, right ? What the big deal to
> remove this type of messages (i'm just interested) ?

* Saving memory, especially at runtime.
* Giving consistent and precise error messages

This series is a first step of trying to move generic error messages
from drivers to subsystem cores.
Abylay Ospan Aug. 10, 2016, 3:06 p.m. UTC | #4
make sense. thanks for explaining and for patch !

2016-08-10 10:56 GMT-04:00 Wolfram Sang <wsa@the-dreams.de>:
>
>> if we do not remove this it's also ok, right ? What the big deal to
>> remove this type of messages (i'm just interested) ?
>
> * Saving memory, especially at runtime.
> * Giving consistent and precise error messages
>
> This series is a first step of trying to move generic error messages
> from drivers to subsystem cores.
>
diff mbox

Patch

diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
index c09c52bc6eabef..b49e4f9788e869 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
@@ -327,11 +327,8 @@  static int netup_i2c_init(struct netup_unidvb_dev *ndev, int bus_num)
 	i2c->adap.dev.parent = &ndev->pci_dev->dev;
 	i2c_set_adapdata(&i2c->adap, i2c);
 	ret = i2c_add_adapter(&i2c->adap);
-	if (ret) {
-		dev_err(&ndev->pci_dev->dev,
-			"%s(): failed to add I2C adapter\n", __func__);
+	if (ret)
 		return ret;
-	}
 	dev_info(&ndev->pci_dev->dev,
 		"%s(): registered I2C bus %d at 0x%x\n",
 		__func__,