diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:57 +0000 |
commit | dc50eab76b709d68175a358d6e23a5a3890764d3 (patch) | |
tree | c754d0390db060af0213ff994f0ac310e4cfd6e9 /drivers/iio/proximity | |
parent | Adding debian version 6.6.15-2. (diff) | |
download | linux-dc50eab76b709d68175a358d6e23a5a3890764d3.tar.xz linux-dc50eab76b709d68175a358d6e23a5a3890764d3.zip |
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/iio/proximity')
-rw-r--r-- | drivers/iio/proximity/cros_ec_mkbp_proximity.c | 6 | ||||
-rw-r--r-- | drivers/iio/proximity/srf04.c | 6 | ||||
-rw-r--r-- | drivers/iio/proximity/sx9310.c | 46 |
3 files changed, 30 insertions, 28 deletions
diff --git a/drivers/iio/proximity/cros_ec_mkbp_proximity.c b/drivers/iio/proximity/cros_ec_mkbp_proximity.c index 571ea18122..4df506bb8b 100644 --- a/drivers/iio/proximity/cros_ec_mkbp_proximity.c +++ b/drivers/iio/proximity/cros_ec_mkbp_proximity.c @@ -239,15 +239,13 @@ static int cros_ec_mkbp_proximity_probe(struct platform_device *pdev) return 0; } -static int cros_ec_mkbp_proximity_remove(struct platform_device *pdev) +static void cros_ec_mkbp_proximity_remove(struct platform_device *pdev) { struct cros_ec_mkbp_proximity_data *data = platform_get_drvdata(pdev); struct cros_ec_device *ec = data->ec; blocking_notifier_chain_unregister(&ec->event_notifier, &data->notifier); - - return 0; } static const struct of_device_id cros_ec_mkbp_proximity_of_match[] = { @@ -263,7 +261,7 @@ static struct platform_driver cros_ec_mkbp_proximity_driver = { .pm = pm_sleep_ptr(&cros_ec_mkbp_proximity_pm_ops), }, .probe = cros_ec_mkbp_proximity_probe, - .remove = cros_ec_mkbp_proximity_remove, + .remove_new = cros_ec_mkbp_proximity_remove, }; module_platform_driver(cros_ec_mkbp_proximity_driver); diff --git a/drivers/iio/proximity/srf04.c b/drivers/iio/proximity/srf04.c index faf2f806ce..86c57672fc 100644 --- a/drivers/iio/proximity/srf04.c +++ b/drivers/iio/proximity/srf04.c @@ -344,7 +344,7 @@ static int srf04_probe(struct platform_device *pdev) return ret; } -static int srf04_remove(struct platform_device *pdev) +static void srf04_remove(struct platform_device *pdev) { struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct srf04_data *data = iio_priv(indio_dev); @@ -355,8 +355,6 @@ static int srf04_remove(struct platform_device *pdev) pm_runtime_disable(data->dev); pm_runtime_set_suspended(data->dev); } - - return 0; } static int srf04_pm_runtime_suspend(struct device *dev) @@ -391,7 +389,7 @@ static const struct dev_pm_ops srf04_pm_ops = { static struct platform_driver srf04_driver = { .probe = srf04_probe, - .remove = srf04_remove, + .remove_new = srf04_remove, .driver = { .name = "srf04-gpio", .of_match_table = of_srf04_match, diff --git a/drivers/iio/proximity/sx9310.c b/drivers/iio/proximity/sx9310.c index d977aacb74..0d230a0dff 100644 --- a/drivers/iio/proximity/sx9310.c +++ b/drivers/iio/proximity/sx9310.c @@ -159,6 +159,11 @@ static_assert(SX9310_NUM_CHANNELS <= SX_COMMON_MAX_NUM_CHANNELS); } #define SX9310_CHANNEL(idx) SX9310_NAMED_CHANNEL(idx, NULL) +struct sx931x_info { + const char *name; + unsigned int whoami; +}; + static const struct iio_chan_spec sx9310_channels[] = { SX9310_CHANNEL(0), /* CS0 */ SX9310_CHANNEL(1), /* CS1 */ @@ -902,7 +907,7 @@ static int sx9310_check_whoami(struct device *dev, struct iio_dev *indio_dev) { struct sx_common_data *data = iio_priv(indio_dev); - unsigned int long ddata; + const struct sx931x_info *ddata; unsigned int whoami; int ret; @@ -910,20 +915,11 @@ static int sx9310_check_whoami(struct device *dev, if (ret) return ret; - ddata = (uintptr_t)device_get_match_data(dev); - if (ddata != whoami) - return -EINVAL; - - switch (whoami) { - case SX9310_WHOAMI_VALUE: - indio_dev->name = "sx9310"; - break; - case SX9311_WHOAMI_VALUE: - indio_dev->name = "sx9311"; - break; - default: + ddata = device_get_match_data(dev); + if (ddata->whoami != whoami) return -ENODEV; - } + + indio_dev->name = ddata->name; return 0; } @@ -1015,23 +1011,33 @@ out: static DEFINE_SIMPLE_DEV_PM_OPS(sx9310_pm_ops, sx9310_suspend, sx9310_resume); +static const struct sx931x_info sx9310_info = { + .name = "sx9310", + .whoami = SX9310_WHOAMI_VALUE, +}; + +static const struct sx931x_info sx9311_info = { + .name = "sx9311", + .whoami = SX9311_WHOAMI_VALUE, +}; + static const struct acpi_device_id sx9310_acpi_match[] = { - { "STH9310", SX9310_WHOAMI_VALUE }, - { "STH9311", SX9311_WHOAMI_VALUE }, + { "STH9310", (kernel_ulong_t)&sx9310_info }, + { "STH9311", (kernel_ulong_t)&sx9311_info }, {} }; MODULE_DEVICE_TABLE(acpi, sx9310_acpi_match); static const struct of_device_id sx9310_of_match[] = { - { .compatible = "semtech,sx9310", (void *)SX9310_WHOAMI_VALUE }, - { .compatible = "semtech,sx9311", (void *)SX9311_WHOAMI_VALUE }, + { .compatible = "semtech,sx9310", &sx9310_info }, + { .compatible = "semtech,sx9311", &sx9311_info }, {} }; MODULE_DEVICE_TABLE(of, sx9310_of_match); static const struct i2c_device_id sx9310_id[] = { - { "sx9310", SX9310_WHOAMI_VALUE }, - { "sx9311", SX9311_WHOAMI_VALUE }, + { "sx9310", (kernel_ulong_t)&sx9310_info }, + { "sx9311", (kernel_ulong_t)&sx9311_info }, {} }; MODULE_DEVICE_TABLE(i2c, sx9310_id); |