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:	Tue, 6 Dec 2011 09:38:20 +0000
From:	Dong Aisheng-B29396 <B29396@...escale.com>
To:	Guo Shawn-R65073 <r65073@...escale.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linus.walleij@...ricsson.com" <linus.walleij@...ricsson.com>,
	"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: RE: [RFC PATCH 1/3] pinctrl: imx: add pinmux imx core driver

> -----Original Message-----
> From: Guo Shawn-R65073
> Sent: Tuesday, December 06, 2011 5:42 PM
> To: Dong Aisheng-B29396
> Cc: linux-kernel@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> linus.walleij@...ricsson.com; s.hauer@...gutronix.de;
> kernel@...gutronix.de
> Subject: Re: [RFC PATCH 1/3] pinctrl: imx: add pinmux imx core driver
> 
> On Sun, Dec 04, 2011 at 07:49:42PM +0800, Dong Aisheng wrote:
> > +static struct pinmux_ops imx_pmx_ops = {
> > +	.list_functions = imx_pmx_list_funcs,
> > +	.get_function_name = imx_pmx_get_func_name,
> > +	.get_function_groups = imx_pmx_get_groups,
> > +	.enable = imx_pmx_enable,
> > +};
> 
> The pinmux core code will check the pinmux_ops as below.  !ops->disable
> is one of the checking, while you do not have .disable hook.
> 
Then I have to add a disable function.

> int pinmux_check_ops(const struct pinmux_ops *ops) {
>         /* Check that we implement required operations */
>         if (!ops->list_functions ||
>             !ops->get_function_name ||
>             !ops->get_function_groups ||
>             !ops->enable ||
>             !ops->disable)
Not sure if we must check !ops->disable here since some soc may not have
disable function.

>                 return -EINVAL;
> 
>         return 0;
> }
> 
> [...]
> 
> > +static int __init imx_pmx_probe(struct platform_device *pdev) {
> > +	struct device *dev = &pdev->dev;
> > +	struct imx_pmx *ipmx;
> > +	struct resource *res;
> > +	struct imx_pinctrl_info *info;
> > +	resource_size_t res_size;
> > +
> > +	info = (struct imx_pinctrl_info *)pdev->id_entry->driver_data;
> > +	if (!info || !info->pins || !info->groups || !info->functions
> > +		|| (info->maxpin > info->npins)) {
> 
> You must mean !(info->maxpin > info->npins) here?
> 
Yes, thanks for this finding.

> Regards,
> Shawn
> 
> > +		dev_err(&pdev->dev, "wrong pinctrl info\n");
> > +		return -EINVAL;
> > +	}

Regards
Dong Aisheng

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ