summaryrefslogtreecommitdiff
path: root/include/linux/platform_data
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-11-20 12:34:41 +0300
committerGuenter Roeck <linux@roeck-us.net>2022-12-05 03:45:03 +0300
commit59882c7f6714141300882af3d39ca6ffecf54ec2 (patch)
tree1c5cec48e3f73f3435f51143b2b6b5c3c92b314a /include/linux/platform_data
parentef9948dfe1056a89f699edc8eb691a8ed99eda5e (diff)
downloadlinux-59882c7f6714141300882af3d39ca6ffecf54ec2.tar.xz
hwmon: (gsc-hwmon) Switch to flexible array to simplify code
Using flexible array is more straight forward. It - saves 1 pointer in the 'gsc_hwmon_platform_data' structure - saves an indirection when using this array - saves some LoC and avoids some always spurious pointer arithmetic Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/61a23e1d642397cfcecc4ac3bb0ab485d257987d.1668936855.git.christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/platform_data')
-rw-r--r--include/linux/platform_data/gsc_hwmon.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/platform_data/gsc_hwmon.h b/include/linux/platform_data/gsc_hwmon.h
index 281f499eda97..f2781aa7eff8 100644
--- a/include/linux/platform_data/gsc_hwmon.h
+++ b/include/linux/platform_data/gsc_hwmon.h
@@ -29,18 +29,17 @@ struct gsc_hwmon_channel {
/**
* struct gsc_hwmon_platform_data - platform data for gsc_hwmon driver
- * @channels: pointer to array of gsc_hwmon_channel structures
- * describing channels
* @nchannels: number of elements in @channels array
* @vreference: voltage reference (mV)
* @resolution: ADC bit resolution
* @fan_base: register base for FAN controller
+ * @channels: array of gsc_hwmon_channel structures describing channels
*/
struct gsc_hwmon_platform_data {
- const struct gsc_hwmon_channel *channels;
int nchannels;
unsigned int resolution;
unsigned int vreference;
unsigned int fan_base;
+ struct gsc_hwmon_channel channels[];
};
#endif