Commit 8281101c authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

staging: iio: isl29018: fix poorly named function

isl29035_detect() did not just do chip detection. Move functionality directly
into isl29018_chip_init() to avoid naming confusion.
Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 744ef62c
...@@ -529,12 +529,20 @@ static const struct attribute_group isl29023_group = { ...@@ -529,12 +529,20 @@ static const struct attribute_group isl29023_group = {
.attrs = isl29023_attributes, .attrs = isl29023_attributes,
}; };
static int isl29035_detect(struct isl29018_chip *chip) enum {
isl29018,
isl29023,
isl29035,
};
static int isl29018_chip_init(struct isl29018_chip *chip)
{ {
int status; int status;
unsigned int id;
struct device *dev = regmap_get_device(chip->regmap); struct device *dev = regmap_get_device(chip->regmap);
if (chip->type == isl29035) {
unsigned int id;
status = regmap_read(chip->regmap, ISL29035_REG_DEVICE_ID, &id); status = regmap_read(chip->regmap, ISL29035_REG_DEVICE_ID, &id);
if (status < 0) { if (status < 0) {
dev_err(dev, dev_err(dev,
...@@ -549,23 +557,9 @@ static int isl29035_detect(struct isl29018_chip *chip) ...@@ -549,23 +557,9 @@ static int isl29035_detect(struct isl29018_chip *chip)
return -ENODEV; return -ENODEV;
/* Clear brownout bit */ /* Clear brownout bit */
return regmap_update_bits(chip->regmap, ISL29035_REG_DEVICE_ID, status = regmap_update_bits(chip->regmap,
ISL29035_REG_DEVICE_ID,
ISL29035_BOUT_MASK, 0); ISL29035_BOUT_MASK, 0);
}
enum {
isl29018,
isl29023,
isl29035,
};
static int isl29018_chip_init(struct isl29018_chip *chip)
{
int status;
struct device *dev = regmap_get_device(chip->regmap);
if (chip->type == isl29035) {
status = isl29035_detect(chip);
if (status < 0) if (status < 0)
return status; return status;
} }
......
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