Re: how to gracefully unload an i2c driver if chip not detected?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks a lot Wolfram!

Emeric

----- Mail original -----
> Hi,
> 
> thanks, that helped, I think:
> 
> >     //test for device presence
> >     if(vcnl4010_read_transfer(data, VCNL4010_PROD_ID_VER, &reg_val,
> >     1) !=0 )
> >     {
> >         pr_err("vcnl4010: Device not found!");
> >         goto nochip;
> >     }
> > 
> >     if(reg_val != 0x21)
> >     {
> >         pr_err("vcnl4010: Found device isn't a vcnl4010, is a
> >         vcnl4000 installed?");
> >         goto badchip;
> >     }
> 
> You should set 'ret = -Esomething' here. Currently, you return 0
> which
> means success, so the driver core thinks it may call the suspend
> function.
> 
> Regards,
> 
>    Wolfram
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux