i2c-amd756: share definition of amd756_smbus
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Ben,
Quoted 4 lines · Ben Dooks (Codethink)
Add a shared header to declare
amd756_smbusthat is used by two files, to remove the following sparse warning:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static?
I can't see this warning, not even with W=1. What did you do to see it?
Quoted 45 lines
Signed-off-by Ben Dooks (Codethink) <[email protected]>---
Cc Jean Delvare <[email protected]>--- drivers/i2c/busses/i2c-amd756-s4882.c | 2 +- drivers/i2c/busses/i2c-amd756.c | 2 ++ drivers/i2c/busses/i2c-amd756.h | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 drivers/i2c/busses/i2c-amd756.hdrivers/i2c/busses/i2c-amd756-s4882.c +1
-1@@ -27,7 +27,7 @@#include <linux/i2c.h> #include <linux/mutex.h> -extern struct i2c_adapter amd756_smbus; +#include "i2c-amd756.h" static struct i2c_adapter *s4882_adapter;static struct i2c_algorithm *s4882_algo;drivers/i2c/busses/i2c-amd756.c +2
-0@@ -32,6 +32,8 @@#include <linux/acpi.h> #include <linux/io.h> +#include "i2c-amd756.h" +/* AMD756 SMBus address offsets */ #define SMB_ADDR_OFFSET 0xE0#define SMB_IOSIZE 16drivers/i2c/busses/i2c-amd756.h new file +0
-0
drivers/i2c/busses/i2c-amd756.h line 4
Quoted 4 lines
drivers/i2c/busses/i2c-amd756.h new file +4
-0@@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* Copyright (c) 2019 Ben Dooks <[email protected]> */ + +extern struct i2c_adapter amd756_smbus;
Please add this new file to MAINTAINERS in section "I2C/SMBUS CONTROLLER DRIVERS FOR PC".
If this driver needs this then i2c-nforce2 needs the same as it exposes nforce2_smbus to i2c-nforce2-s4985 in the very same way.
Ideally both drivers would be reworked to use the standard I2C multiplexing framework, then we could get rid of the extra pseudo-drivers.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 9 lines · Jean Delvare
Hi Ben,
Quoted 4 lines · Ben Dooks (Codethink)
Add a shared header to declare
amd756_smbusthat is used by two files, to remove the following sparse warning:
drivers/i2c/busses/i2c-amd756.c:286:20: warning: symbol 'amd756_smbus' was not declared. Should it be static?I can't see this warning, not even with W=1. What did you do to see it?
Was running C=1, looks like output from sparse.