Commit 02819966 authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, RW} macros

Use the IIO_DEVICE_ATTR_RO and IIO_DEVICE_ATTR_RW macros to
create the device attributes.
Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent f3b0deea
...@@ -268,8 +268,9 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme, ...@@ -268,8 +268,9 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
return 0; return 0;
} }
static ssize_t isl29018_show_scale_available(struct device *dev, static ssize_t in_illuminance_scale_available_show
struct device_attribute *attr, char *buf) (struct device *dev, struct device_attribute *attr,
char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -286,8 +287,9 @@ static ssize_t isl29018_show_scale_available(struct device *dev, ...@@ -286,8 +287,9 @@ static ssize_t isl29018_show_scale_available(struct device *dev,
return len; return len;
} }
static ssize_t isl29018_show_int_time_available(struct device *dev, static ssize_t in_illuminance_integration_time_available_show
struct device_attribute *attr, char *buf) (struct device *dev, struct device_attribute *attr,
char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -303,9 +305,9 @@ static ssize_t isl29018_show_int_time_available(struct device *dev, ...@@ -303,9 +305,9 @@ static ssize_t isl29018_show_int_time_available(struct device *dev,
return len; return len;
} }
static ssize_t isl29018_show_prox_infrared_suppression(struct device *dev, static ssize_t proximity_on_chip_ambient_infrared_suppression_show
struct device_attribute *attr, (struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -317,9 +319,9 @@ static ssize_t isl29018_show_prox_infrared_suppression(struct device *dev, ...@@ -317,9 +319,9 @@ static ssize_t isl29018_show_prox_infrared_suppression(struct device *dev,
return sprintf(buf, "%d\n", chip->prox_scheme); return sprintf(buf, "%d\n", chip->prox_scheme);
} }
static ssize_t isl29018_store_prox_infrared_suppression(struct device *dev, static ssize_t proximity_on_chip_ambient_infrared_suppression_store
struct device_attribute *attr, (struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -471,14 +473,9 @@ static const struct iio_chan_spec isl29023_channels[] = { ...@@ -471,14 +473,9 @@ static const struct iio_chan_spec isl29023_channels[] = {
ISL29018_IR_CHANNEL, ISL29018_IR_CHANNEL,
}; };
static IIO_DEVICE_ATTR(in_illuminance_integration_time_available, S_IRUGO, static IIO_DEVICE_ATTR_RO(in_illuminance_integration_time_available, 0);
isl29018_show_int_time_available, NULL, 0); static IIO_DEVICE_ATTR_RO(in_illuminance_scale_available, 0);
static IIO_DEVICE_ATTR(in_illuminance_scale_available, S_IRUGO, static IIO_DEVICE_ATTR_RW(proximity_on_chip_ambient_infrared_suppression, 0);
isl29018_show_scale_available, NULL, 0);
static IIO_DEVICE_ATTR(proximity_on_chip_ambient_infrared_suppression,
S_IRUGO | S_IWUSR,
isl29018_show_prox_infrared_suppression,
isl29018_store_prox_infrared_suppression, 0);
#define ISL29018_DEV_ATTR(name) (&iio_dev_attr_##name.dev_attr.attr) #define ISL29018_DEV_ATTR(name) (&iio_dev_attr_##name.dev_attr.attr)
......
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