On Thu, Feb 03, 2011 at 04:01:17PM +0200, Iiro Valkonen wrote:
quoted hunk ↗ jump to hunk
+ 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