Skip to content

Commit

Permalink
Merge branch 'hwmon-const' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
groeck committed Apr 19, 2023
2 parents 0c07238 + d8cc941 commit 629f57a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Documentation/hwmon/hwmon-kernel-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The hwmon_chip_info structure looks as follows::

struct hwmon_chip_info {
const struct hwmon_ops *ops;
const struct hwmon_channel_info **info;
const struct hwmon_channel_info * const *info;
};

It contains the following fields:
Expand Down Expand Up @@ -229,7 +229,7 @@ register (HWMON_T_MAX) as well as a maximum temperature hysteresis register
.config = lm75_temp_config,
};

static const struct hwmon_channel_info *lm75_info[] = {
static const struct hwmon_channel_info * const lm75_info[] = {
&lm75_chip,
&lm75_temp,
NULL
Expand All @@ -238,7 +238,7 @@ register (HWMON_T_MAX) as well as a maximum temperature hysteresis register
The HWMON_CHANNEL_INFO() macro can and should be used when possible.
With this macro, the above example can be simplified to

static const struct hwmon_channel_info *lm75_info[] = {
static const struct hwmon_channel_info * const lm75_info[] = {
HWMON_CHANNEL_INFO(chip,
HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
HWMON_CHANNEL_INFO(temp,
Expand Down
2 changes: 1 addition & 1 deletion drivers/accel/habanalabs/common/hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ void hl_hwmon_fini(struct hl_device *hdev)

void hl_hwmon_release_resources(struct hl_device *hdev)
{
const struct hwmon_channel_info **channel_info_arr;
const struct hwmon_channel_info * const *channel_info_arr;
int i = 0;

if (!hdev->hl_chip_info->info)
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static int hwmon_thermal_set_trips(struct thermal_zone_device *tz, int low, int
struct hwmon_thermal_data *tdata = tz->devdata;
struct hwmon_device *hwdev = to_hwmon_device(tdata->dev);
const struct hwmon_chip_info *chip = hwdev->chip;
const struct hwmon_channel_info **info = chip->info;
const struct hwmon_channel_info * const *info = chip->info;
unsigned int i;
int err;

Expand Down Expand Up @@ -253,7 +253,7 @@ static int hwmon_thermal_register_sensors(struct device *dev)
{
struct hwmon_device *hwdev = to_hwmon_device(dev);
const struct hwmon_chip_info *chip = hwdev->chip;
const struct hwmon_channel_info **info = chip->info;
const struct hwmon_channel_info * const *info = chip->info;
void *drvdata = dev_get_drvdata(dev);
int i;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/hwmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ struct hwmon_channel_info {
*/
struct hwmon_chip_info {
const struct hwmon_ops *ops;
const struct hwmon_channel_info **info;
const struct hwmon_channel_info * const *info;
};

/* hwmon_device_register() is deprecated */
Expand Down

0 comments on commit 629f57a

Please sign in to comment.