Re: [PATCH v5 4/5] hwmon: add MAX197 support

From: Vivien Didelot
Date: Mon Feb 20 2012 - 14:56:34 EST


On Mon, 20 Feb 2012 10:27:02 -0800,
Guenter Roeck <guenter.roeck@xxxxxxxxxxxx> wrote:

> > I check the platform_device_register_simple() returned value
> > because it is the platform itself, while the others are on-board
> > devices. I thought that it is not a big deal if their registrations
> > failed but the platform registration succeeded. Maybe I'm wrong and
> > I should check everything.
> >
> Hmm .. seems to make sense. Ok with me. Only question is if you would
> want to have it fail silently or issue a log message (possibly debug)
> to report the failure.

Ok, I'll go for something like the following:

if (led_classdev_register(&pdev->dev, &ts5500_led_cdev))
dev_warn(ts5500_led_cdev.dev, "failed to register the LED\n");
if (ts5500->adc) {
ts5500_adc_pdev.dev.parent = &pdev->dev;
if (platform_device_register(&ts5500_adc_pdev))
dev_warn(&ts5500_adc_pdev.dev,
"failed to register the A/D converter\n");
}

Thanks,

--
Vivien Didelot
Savoir-faire Linux Inc.
Tel: (514) 276-5468 #149
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/