-----BEGIN PGP SIGNED MESSAGE----- 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iEYEARECAAYFAkhWRFEACgkQOjLpvpq7dMoEQwCcD1ferlEs3+V3ztnhopkAqG5E 3rYAn3HmyN5eYcm2aHp/F6TkdEGQY8KP =WyOQ -----END PGP SIGNATURE-----
