[PATCH 04/10] fix-pcf50633-disable-irq-from-suspend-until-resume.patch

Andy Green andy at openmoko.com
Mon Jun 16 12:45:37 CEST 2008

Hash: SHA1

Somebody in the thread at some point said:
| On Monday 16 June 2008 00:17:27 Andy Green wrote:
|> Lastly I noticed that in early resume, i2c_get_clientdata(&pcf->client)
| interesting.
|> +	/* sanity */
|> +	if (!&pcf->client.dev)
|> +		goto bail;
|> +
|> +	/* this is the case early in resume! Sanity check! */
|> +	if (i2c_get_clientdata(&pcf->client) == NULL)
|>  		goto reschedule;
| Use i2c_get_clientdata in both cases? or is there a difference?

No they're different (but I had to go check :-) )  pcf comes from
container_of(), which works by subtracting the element offset for .work
from its pointer, resulting in offset 0 of the containing struct.  So
this is guaranteed to be clean if work pointer is valid.  Both "client"
and "client.dev" are composed objects inside the pcf50633_data struct
that pcf points to, so can't fail on NULL pointer.

But i2c_get_clientdata() is looking at a member of the client struct
itself, which can get set or reset presumably by I2C layer as it likes.

- -Andy
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


More information about the openmoko-kernel mailing list