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

From
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date
2011-02-04 08:58:02
Reply to
Iiro Valkonen, 2011-02-03
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
Thread (32 messages) 32 messages, 4 authors, last reply 2011-02-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help