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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Oct 2012 10:37:25 +0000
From:	"Tc, Jenny" <jenny.tc@...el.com>
To:	"myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>,
	??? <cw00.choi@...sung.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"myungjoo.ham@...il.com" <myungjoo.ham@...il.com>
Subject: RE: [PATCH] extcon : register for cable interest by cable name



> Subject: Re: [PATCH] extcon : register for cable interest by cable name
> 
> > There are some scnearios where a driver/framework needs to register
> > interest for a particular cable without specifying the extcon device
> > name. One such scenario is charger notifications. The platform will
> > have charger cabel which will be bound to any extcon device. It's not
> > mandatory for the charger driver to know which extcon device it should
> > use. This patch enables the support for registering interest for a
> > cable just by cable name wihtout specifying the extcon device name
> >
> > Signed-off-by: Jenny TC <jenny.tc@...el.com>
> > ---
> []
> > +extern struct extcon_dev *register_interest_cable_byname
> > +		(struct extcon_specific_cable_nb *extcon_dev,
> > +		const char *cable_name, struct notifier_block *nb);
> 
> What about allowing extcon_register_interest() to support the functionality?
> 
register_interest_cable_byname  internally uses extcon_register_interest   function.
If we want to use  extcon_register_interest()  in both scenarios,  then we need to define
two local functions 

 extcon_register_interest__ and  register_interest_cable_byname. 

Then the code would be

int extcon_register_interest(struct extcon_specific_cable_nb *obj,
		 const char *extcon_name, const char *cable_name,
                             	struct notifier_block *nb) {

	if (extcon_name == NULL)
		return register_interest_cable_byname(obj,cable_name,nb);
	else
		return extcon_register_interest__(obj,extcon_name,cable_name,nb);
}

Is that fine?

> I.e., allowing extcon_register_interest() to accept NULL extcon_name.
> 
> 
> ps. anyway, usually, the "platforms" have the list of node paths, don't they?
>
My intention is to make it generic and less dependent on platform data. This way the same consumer
driver can work on any platform without looking for extcon dev name in the platform data. 
For example a charger driver can work on any platform without knowing the extcon provider name for
The charger cable.

 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ