From: "Émeric Vigier" <emeric.vigier-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: how to gracefully unload an i2c driver if chip not detected?
Date: Mon, 22 Apr 2013 07:18:35 -0400 (EDT) [thread overview]
Message-ID: <1001950529.54.1366629515916.JavaMail.root@mail> (raw)
In-Reply-To: <20130421154832.GA9593-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
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, ®_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
>
>
prev parent reply other threads:[~2013-04-22 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <931575758.126890.1363615027376.JavaMail.root@mail>
2013-03-18 14:47 ` how to gracefully unload an i2c driver if chip not detected? Émeric Vigier
2013-04-09 9:26 ` Wolfram Sang
[not found] ` <20130409092625.GD3624-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-04-21 3:38 ` Émeric Vigier
2013-04-21 15:48 ` Wolfram Sang
[not found] ` <20130421154832.GA9593-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-04-22 11:18 ` Émeric Vigier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1001950529.54.1366629515916.JavaMail.root@mail \
--to=emeric.vigier-4ysuxcep3am1wj+d4i0nrvatqe2ktcn/@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).