Commit 5679ed99 authored by Jean Delvare's avatar Jean Delvare Committed by Guenter Roeck

hwmon: (occ) Move common code to a separate module

Instead of duplicating the common code into the 2 (binary) drivers,
move the common code to a separate module. This is cleaner.
Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Cc: Eddie James <eajames@linux.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarEddie James <eajames@linux.ibm.com>
Tested-by: default avatarEddie James <eajames@linux.ibm.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 14b97ba5
...@@ -27,5 +27,4 @@ config SENSORS_OCC_P9_SBE ...@@ -27,5 +27,4 @@ config SENSORS_OCC_P9_SBE
called occ-p9-hwmon. called occ-p9-hwmon.
config SENSORS_OCC config SENSORS_OCC
bool "POWER On-Chip Controller" tristate
depends on SENSORS_OCC_P8_I2C || SENSORS_OCC_P9_SBE
occ-p8-hwmon-objs := common.o sysfs.o p8_i2c.o occ-hwmon-common-objs := common.o sysfs.o
occ-p9-hwmon-objs := common.o sysfs.o p9_sbe.o occ-p8-hwmon-objs := p8_i2c.o
occ-p9-hwmon-objs := p9_sbe.o
obj-$(CONFIG_SENSORS_OCC) += occ-hwmon-common.o
obj-$(CONFIG_SENSORS_OCC_P8_I2C) += occ-p8-hwmon.o obj-$(CONFIG_SENSORS_OCC_P8_I2C) += occ-p8-hwmon.o
obj-$(CONFIG_SENSORS_OCC_P9_SBE) += occ-p9-hwmon.o obj-$(CONFIG_SENSORS_OCC_P9_SBE) += occ-p9-hwmon.o
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
// Copyright IBM Corp 2019 // Copyright IBM Corp 2019
#include <linux/device.h> #include <linux/device.h>
#include <linux/export.h>
#include <linux/hwmon.h> #include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h> #include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/math64.h> #include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -1099,3 +1101,8 @@ int occ_setup(struct occ *occ, const char *name) ...@@ -1099,3 +1101,8 @@ int occ_setup(struct occ *occ, const char *name)
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(occ_setup);
MODULE_AUTHOR("Eddie James <eajames@linux.ibm.com>");
MODULE_DESCRIPTION("Common OCC hwmon code");
MODULE_LICENSE("GPL");
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/export.h>
#include <linux/hwmon-sysfs.h> #include <linux/hwmon-sysfs.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sysfs.h> #include <linux/sysfs.h>
...@@ -177,3 +178,4 @@ void occ_shutdown(struct occ *occ) ...@@ -177,3 +178,4 @@ void occ_shutdown(struct occ *occ)
{ {
sysfs_remove_group(&occ->bus_dev->kobj, &occ_sysfs); sysfs_remove_group(&occ->bus_dev->kobj, &occ_sysfs);
} }
EXPORT_SYMBOL_GPL(occ_shutdown);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment