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  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, 7 Oct 2014 10:26:06 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	"Ivan T. Ivanov" <iivanov@...sol.com>
Cc:	Stephen Boyd <sboyd@...eaurora.org>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH 2/4] Input: pmic8xxx-keypad - use regmap_field for
 register access

Hi Ivan,

On Tue, Oct 07, 2014 at 12:50:46PM +0300, Ivan T. Ivanov wrote:
> @@ -527,10 +538,55 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, kp);
>  
> +	if (rows < info->min_rows)
> +		rows = info->min_rows;
> +
> +	if (cols < info->min_cols)
> +		cols = info->min_cols;
> +
>  	kp->num_rows	= rows;
>  	kp->num_cols	= cols;
>  	kp->dev		= &pdev->dev;
>  
> +	kp->events = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +					     info->events);
> +	if (IS_ERR(kp->events))
> +		return PTR_ERR(kp->events);
> +
> +	kp->scan_rows = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +						info->scan_rows);
> +	if (IS_ERR(kp->scan_rows))
> +		return PTR_ERR(kp->scan_rows);
> +
> +	kp->scan_cols = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +						info->scan_cols);
> +	if (IS_ERR(kp->scan_cols))
> +		return PTR_ERR(kp->scan_cols);
> +
> +	kp->enable = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +					     info->enable);
> +	if (IS_ERR(kp->enable))
> +		return PTR_ERR(kp->enable);
> +
> +	kp->read_state = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +						 info->read_state);
> +	if (IS_ERR(kp->read_state))
> +		return PTR_ERR(kp->read_state);
> +
> +	kp->dbonce = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +					     info->dbonce);
> +	if (IS_ERR(kp->dbonce))
> +		return PTR_ERR(kp->dbonce);
> +
> +	kp->pause = devm_regmap_field_alloc(kp->dev, kp->regmap, info->pause);
> +	if (IS_ERR(kp->pause))
> +		return PTR_ERR(kp->pause);
> +
> +	kp->row_hold = devm_regmap_field_alloc(kp->dev, kp->regmap,
> +					       info->row_hold);
> +	if (IS_ERR(kp->row_hold))
> +		return PTR_ERR(kp->row_hold);

Why do we have to allocate all regmap fields separately instead of
embedding them into keypad structure?

Thanks.

-- 
Dmitry
--
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