PCA953x : Fix compilation warning.
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
@@ -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
Quoted 28 lines · Sriramakrishnan
The platform data structure defined in pca953x header file includes references to i2c data structures. Unless the
i2c.hfile is included ahead ofpca953x.h, compiler warning would be generated wherever pca953x header file is included. Addedi2c.hto thepca953x.hitself to remove this dependency.Also included conditional compile macros to guard against multiple inclusion.
Signed-off-by Sriramakrishnan <[email protected]>--- include/linux/i2c/pca953x.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)include/linux/i2c/pca953x.h +5
-0@@ -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