lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170201171039.GB40045@dtor-ws>
Date:   Wed, 1 Feb 2017 09:10:39 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Wolfram Sang <wsa@...-dreams.de>
Subject: Re: [PATCH v2 4/4] i2c: allow specify device properties in
 i2c_board_info

On Wed, Feb 01, 2017 at 05:24:18PM +0200, Mika Westerberg wrote:
> On Tue, Jan 31, 2017 at 06:11:30PM -0800, Dmitry Torokhov wrote:
> > With many drivers converting to using generic device properties, it is
> > useful to provide array of device properties when instantiating new i2c
> > client via i2c_board_info and have them automatically added to the device
> > in question.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> > ---
> >  drivers/i2c/i2c-core.c | 16 +++++++++++++++-
> >  include/linux/i2c.h    |  3 +++
> >  2 files changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> > index f009549f86a5..3897e78e5e9a 100644
> > --- a/drivers/i2c/i2c-core.c
> > +++ b/drivers/i2c/i2c-core.c
> > @@ -1335,15 +1335,29 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
> >  	client->dev.fwnode = info->fwnode;
> >  
> >  	i2c_dev_set_name(adap, client);
> > +
> > +	if (info->properties) {
> > +		status = device_add_properties(&client->dev, info->properties);
> 
> I don't remember anymore how it was but is the driver core supposed to
> free this automatically when the device is removed or should we deal
> this in the i2c-core instead?
> 

It is done as part of device_del().

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ