Skip to contentSkip to conversation

PCA953x : Fix compilation warning.

PATCH In review Sriramakrishnan 2 participants 2 messages Feb 25, 2010 1 message not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCA953x : Fix compilation warning.

The platform data structure defined in pca953x header file includes references to i2c data structures. Unless the i2c.h file is included ahead of pca953x.h, compiler warning would be generated wherever pca953x header file is included. Added i2c.h to the pca953x.h itself to remove this dependency.

Also included conditional compile macros to guard against multiple inclusion.

---
 include/linux/i2c/pca953x.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
include/linux/i2c/pca953x.h +6 -0
index 81736d6..1284a2d 100644
@@ -1,3 +1,8 @@
+#ifndef __LINUX_PCA953X_H
+#define __LINUX_PCA953X_H
+
+#include <linux/i2c.h>
+
 /* platform data for the PCA9539 16-bit I/O expander driver */
 
 struct pca953x_platform_data {
@@ -17,3 +22,4 @@ struct pca953x_platform_data {
 				void *context);
 	char		**names;
 };
+#endif
Signature · 1 line
1.6.2.4

A message that is not in the archive (sent off-list or not yet received): 1267104758-32131-1-git-send-email-srk-l0cyMroinI0@public.gmane.org

#2 lore raw
Quoted 28 lines · Sriramakrishnan

The platform data structure defined in pca953x header file includes references to i2c data structures. Unless the i2c.h file is included ahead of pca953x.h, compiler warning would be generated wherever pca953x header file is included. Added i2c.h to the pca953x.h itself to remove this dependency.

Also included conditional compile macros to guard against multiple inclusion.

---
 include/linux/i2c/pca953x.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
include/linux/i2c/pca953x.h +5 -0
index 81736d6..1284a2d 100644
@@ -1,3 +1,8 @@
+#ifndef __LINUX_PCA953X_H
+#define __LINUX_PCA953X_H
+
+#include <linux/i2c.h>
+
 /* platform data for the PCA9539 16-bit I/O expander driver */
 
 struct pca953x_platform_data {

include/linux/i2c/pca953x.h struct pca953x_platform_data { · line 25

Quoted 4 lines
include/linux/i2c/pca953x.h +1 -0
@@ -17,3 +22,4 @@ struct pca953x_platform_data {
 				void *context);
 	char		**names;
 };
+#endif

Olof Johansson already sent a patch fixing this:
http://lkml.org/lkml/2010/1/5/327

Andrew Morton accepted this patch so it should go to Linus during the next merge window (that is, within the next 2 weeks.)

Signature · 1 line
Jean Delvare