Re: [PATCH 1/5] Remove fixed config data from driver file; add config to platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 03, 2011 at 04:01:17PM +0200, Iiro Valkonen wrote:
> +	if (pdata->config) {
> +		init_vals = (u8 *)pdata->config;
> +	} else {
> +		dev_err(dev, "No cfg data defined, skipping reg init\n");
> +		return 0;
>  	}
>  
>  	for (i = 0; i < data->info.object_num; i++) {
> diff --git a/include/linux/i2c/qt602240_ts.h b/include/linux/i2c/qt602240_ts.h
> index 0b4c72f..130f8bc 100644
> --- a/include/linux/i2c/qt602240_ts.h
> +++ b/include/linux/i2c/qt602240_ts.h
> @@ -33,6 +33,7 @@ struct mxt_platform_data {
>  	unsigned int threshold;
>  	unsigned int voltage;
>  	unsigned char orient;
> +	unsigned char *config;

This should be "const u8 *config". Also it would be a good idea to also
pass length and validate it when dereferencing.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux