mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* i2c_use_client broken
@ 2004-03-04  6:34 Kevin O'Connor
  2004-03-09 23:04 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin O'Connor @ 2004-03-04  6:34 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel

Hi Greg,

In 2.6.3's i2c-core.c there is the following code:

static int i2c_inc_use_client(struct i2c_client *client)
{

        if (!try_module_get(client->driver->owner))
                return -ENODEV;
        if (!try_module_get(client->adapter->owner)) {
                module_put(client->driver->owner);
                return -ENODEV;
        }

        return 0;
}
[...]
int i2c_use_client(struct i2c_client *client)
{
        if (!i2c_inc_use_client(client))
                return -ENODEV;
[...]

The i2c_inc_use_client test looks backward - the code should look like:

        if (i2c_inc_use_client(client))
                return -ENODEV;

because i2c_inc_use_client returns 0 on success.

If I've missed something, please let me know.  I apologize if you're not
the right person to mail or if this has already been fixed.

-Kevin

-- 
 ---------------------------------------------------------------------
 | Kevin O'Connor                  "BTW, IMHO we need a FAQ for      |
 | kevin@koconnor.net               'IMHO', 'FAQ', 'BTW', etc. !"    |
 ---------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-09 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-04  6:34 i2c_use_client broken Kevin O'Connor
2004-03-09 23:04 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®