Skip to content

Commit fc669e9

Browse files
Hunterteaegggroeck
authored andcommitted
hwmon: (sht3x) remove sht3x_platform_data
Since no in-tree driver supports it, sht3x_platform_data has been removed and the relevant properties have been moved to sht3x_data. Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com> Link: https://lore.kernel.org/r/DB4PR10MB626126FB7226D5AF341197449258A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 450d1a8 commit fc669e9

3 files changed

Lines changed: 9 additions & 28 deletions

File tree

Documentation/hwmon/sht3x.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The device communicates with the I2C protocol. Sensors can have the I2C
2828
addresses 0x44 or 0x45, depending on the wiring. See
2929
Documentation/i2c/instantiating-devices.rst for methods to instantiate the device.
3030

31-
There are two options configurable by means of sht3x_platform_data:
31+
There are two options configurable by means of sht3x_data:
3232

3333
1. blocking (pull the I2C clock line down while performing the measurement) or
3434
non-blocking mode. Blocking mode will guarantee the fastest result but

drivers/hwmon/sht3x.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/module.h>
2121
#include <linux/slab.h>
2222
#include <linux/jiffies.h>
23-
#include <linux/platform_data/sht3x.h>
2423

2524
/* commands (high precision mode) */
2625
static const unsigned char sht3x_cmd_measure_blocking_hpm[] = { 0x2c, 0x06 };
@@ -135,8 +134,8 @@ struct sht3x_data {
135134
const unsigned char *command;
136135
u32 wait_time; /* in us*/
137136
unsigned long last_update; /* last update in periodic mode*/
138-
139-
struct sht3x_platform_data setup;
137+
bool blocking_io;
138+
bool high_precision;
140139

141140
/*
142141
* cached values for temperature and humidity and limits
@@ -441,13 +440,13 @@ static void sht3x_select_command(struct sht3x_data *data)
441440
if (data->mode > 0) {
442441
data->command = sht3x_cmd_measure_periodic_mode;
443442
data->wait_time = 0;
444-
} else if (data->setup.blocking_io) {
445-
data->command = data->setup.high_precision ?
443+
} else if (data->blocking_io) {
444+
data->command = data->high_precision ?
446445
sht3x_cmd_measure_blocking_hpm :
447446
sht3x_cmd_measure_blocking_lpm;
448447
data->wait_time = 0;
449448
} else {
450-
if (data->setup.high_precision) {
449+
if (data->high_precision) {
451450
data->command = sht3x_cmd_measure_nonblocking_hpm;
452451
data->wait_time = SHT3X_NONBLOCKING_WAIT_TIME_HPM;
453452
} else {
@@ -595,7 +594,7 @@ static ssize_t update_interval_store(struct device *dev,
595594
}
596595

597596
if (mode > 0) {
598-
if (data->setup.high_precision)
597+
if (data->high_precision)
599598
command = periodic_measure_commands_hpm[mode - 1];
600599
else
601600
command = periodic_measure_commands_lpm[mode - 1];
@@ -690,16 +689,13 @@ static int sht3x_probe(struct i2c_client *client)
690689
if (!data)
691690
return -ENOMEM;
692691

693-
data->setup.blocking_io = false;
694-
data->setup.high_precision = true;
692+
data->blocking_io = false;
693+
data->high_precision = true;
695694
data->mode = 0;
696695
data->last_update = jiffies - msecs_to_jiffies(3000);
697696
data->client = client;
698697
crc8_populate_msb(sht3x_crc8_table, SHT3X_CRC8_POLYNOMIAL);
699698

700-
if (client->dev.platform_data)
701-
data->setup = *(struct sht3x_platform_data *)dev->platform_data;
702-
703699
sht3x_select_command(data);
704700

705701
mutex_init(&data->i2c_lock);

include/linux/platform_data/sht3x.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)