Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1596485

Re: [PATCH 1/8] i2c: export i2c_client_type structure

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/8] i2c: export i2c_client_type structure
Date 2017-03-10 00:50 +0100
Message-ID <tjfYJ-3JY-1@gated-at.bofh.it> (permalink)
References <tjezD-2W7-9@gated-at.bofh.it> <tjezE-2W7-15@gated-at.bofh.it> <tjfvH-3x7-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Mar 10, 2017 at 12:12:46AM +0100, Wolfram Sang wrote:
> Dmitry,
> 
> On Thu, Mar 09, 2017 at 02:16:37PM -0800, Dmitry Torokhov wrote:
> > i2c bus has 2 different types of device belonging to the same bus and
> > bus notifiers use device type to distinguish between adapters and clients.
> > Previously we only had i2c_adapter_type exported, which made code wanting
> > to work with i2c_client devices test for type not equal to adapter type.
> > This unfortunately is not safe if we ever add another type to the bus,
> > so let's export i2c_client_type as well.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> > 
> > Wolfram, this is the patch I was talking about in the other mail.
> 
> I see. From a glimpse, I am fine with the patch. I'll add Jean Delvare
> to CC, though, in case I missed some detail he still knows. Furthermore,
> while I agree that testing for "not adapter" when one means "is client"
> is not nice, is there a bigger benefit than being correct in your queue?

No, just my dislike of testing for "dev->type != &i2c_adapter_type" in
the new i2c bus notifier when we want to work with i2c clients.

Thanks.

-- 
Dmitry

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/8] i2c: export i2c_client_type structure Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-03-09 23:20 +0100
  Re: [PATCH 1/8] i2c: export i2c_client_type structure Wolfram Sang <wsa@the-dreams.de> - 2017-03-10 00:20 +0100
    Re: [PATCH 1/8] i2c: export i2c_client_type structure Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-03-10 00:50 +0100
      Re: [PATCH 1/8] i2c: export i2c_client_type structure Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-03-10 01:00 +0100
    Re: [PATCH 1/8] i2c: export i2c_client_type structure Jean Delvare <jdelvare@suse.de> - 2017-03-13 15:00 +0100

csiph-web