From 9b643e312d528f291966c1f30b0d90bf3b1d43dc Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 16 Sep 2017 14:10:41 +0900 Subject: treewide: replace with error() with pr_err() U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // @@@@ -error +pr_err (...) // Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass [trini: Re-run Coccinelle] Signed-off-by: Tom Rini --- drivers/power/pmic/as3722.c | 12 ++++++------ drivers/power/pmic/as3722_gpio.c | 10 +++++----- drivers/power/pmic/i2c_pmic_emul.c | 6 +++--- drivers/power/pmic/lp873x.c | 4 ++-- drivers/power/pmic/lp87565.c | 4 ++-- drivers/power/pmic/max77686.c | 4 ++-- drivers/power/pmic/max8997.c | 4 ++-- drivers/power/pmic/max8998.c | 4 ++-- drivers/power/pmic/palmas.c | 4 ++-- drivers/power/pmic/pfuze100.c | 4 ++-- drivers/power/pmic/s2mps11.c | 4 ++-- drivers/power/pmic/s5m8767.c | 4 ++-- drivers/power/pmic/sandbox.c | 6 +++--- drivers/power/pmic/tps65090.c | 4 ++-- drivers/power/regulator/fixed.c | 2 +- drivers/power/regulator/gpio-regulator.c | 2 +- drivers/power/regulator/max77686.c | 20 ++++++++++---------- drivers/power/regulator/pbias_regulator.c | 6 +++--- drivers/power/regulator/sandbox.c | 18 +++++++++--------- 19 files changed, 61 insertions(+), 61 deletions(-) (limited to 'drivers/power') diff --git a/drivers/power/pmic/as3722.c b/drivers/power/pmic/as3722.c index 4efe8ee..3b0427e 100644 --- a/drivers/power/pmic/as3722.c +++ b/drivers/power/pmic/as3722.c @@ -46,14 +46,14 @@ static int as3722_read_id(struct udevice *dev, uint *idp, uint *revisionp) ret = pmic_reg_read(dev, AS3722_ASIC_ID1); if (ret < 0) { - error("failed to read ID1 register: %d", ret); + pr_err("failed to read ID1 register: %d", ret); return ret; } *idp = ret; ret = pmic_reg_read(dev, AS3722_ASIC_ID2); if (ret < 0) { - error("failed to read ID2 register: %d", ret); + pr_err("failed to read ID2 register: %d", ret); return ret; } *revisionp = ret; @@ -71,7 +71,7 @@ int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value) ret = pmic_reg_write(dev, AS3722_SD_VOLTAGE(sd), value); if (ret < 0) { - error("failed to write SD%u voltage register: %d", sd, ret); + pr_err("failed to write SD%u voltage register: %d", sd, ret); return ret; } @@ -87,7 +87,7 @@ int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value) ret = pmic_reg_write(dev, AS3722_LDO_VOLTAGE(ldo), value); if (ret < 0) { - error("failed to write LDO%u voltage register: %d", ldo, + pr_err("failed to write LDO%u voltage register: %d", ldo, ret); return ret; } @@ -102,12 +102,12 @@ static int as3722_probe(struct udevice *dev) ret = as3722_read_id(dev, &id, &revision); if (ret < 0) { - error("failed to read ID: %d", ret); + pr_err("failed to read ID: %d", ret); return ret; } if (id != AS3722_DEVICE_ID) { - error("unknown device"); + pr_err("unknown device"); return -ENOENT; } diff --git a/drivers/power/pmic/as3722_gpio.c b/drivers/power/pmic/as3722_gpio.c index d0b681c..5cf4cb6 100644 --- a/drivers/power/pmic/as3722_gpio.c +++ b/drivers/power/pmic/as3722_gpio.c @@ -26,7 +26,7 @@ int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio, err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value); if (err) { - error("failed to configure GPIO#%u: %d", gpio, err); + pr_err("failed to configure GPIO#%u: %d", gpio, err); return err; } @@ -46,7 +46,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio, err = pmic_reg_read(pmic, AS3722_GPIO_SIGNAL_OUT); if (err < 0) { - error("failed to read GPIO signal out register: %d", err); + pr_err("failed to read GPIO signal out register: %d", err); return err; } value = err; @@ -61,7 +61,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio, err = pmic_reg_write(pmic, AS3722_GPIO_SIGNAL_OUT, value); if (err) { - error("failed to set GPIO#%u %s: %d", gpio, l, err); + pr_err("failed to set GPIO#%u %s: %d", gpio, l, err); return err; } @@ -84,13 +84,13 @@ int as3722_gpio_direction_output(struct udevice *dev, unsigned int gpio, err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value); if (err) { - error("failed to configure GPIO#%u as output: %d", gpio, err); + pr_err("failed to configure GPIO#%u as output: %d", gpio, err); return err; } err = as3722_gpio_set_value(pmic, gpio, value); if (err < 0) { - error("failed to set GPIO#%u high: %d", gpio, err); + pr_err("failed to set GPIO#%u high: %d", gpio, err); return err; } diff --git a/drivers/power/pmic/i2c_pmic_emul.c b/drivers/power/pmic/i2c_pmic_emul.c index 2d35d09..38a2a04 100644 --- a/drivers/power/pmic/i2c_pmic_emul.c +++ b/drivers/power/pmic/i2c_pmic_emul.c @@ -31,7 +31,7 @@ static int sandbox_i2c_pmic_read_data(struct udevice *emul, uchar chip, struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul); if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) { - error("Request exceeds PMIC register range! Max register: %#x", + pr_err("Request exceeds PMIC register range! Max register: %#x", SANDBOX_PMIC_REG_COUNT); return -EFAULT; } @@ -68,7 +68,7 @@ static int sandbox_i2c_pmic_write_data(struct udevice *emul, uchar chip, len--; if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) { - error("Request exceeds PMIC register range! Max register: %#x", + pr_err("Request exceeds PMIC register range! Max register: %#x", SANDBOX_PMIC_REG_COUNT); } @@ -111,7 +111,7 @@ static int sandbox_i2c_pmic_ofdata_to_platdata(struct udevice *emul) SANDBOX_PMIC_REG_COUNT); if (!reg_defaults) { - error("Property \"reg-defaults\" not found for device: %s!", + pr_err("Property \"reg-defaults\" not found for device: %s!", emul->name); return -EINVAL; } diff --git a/drivers/power/pmic/lp873x.c b/drivers/power/pmic/lp873x.c index f505468..95c2b7e 100644 --- a/drivers/power/pmic/lp873x.c +++ b/drivers/power/pmic/lp873x.c @@ -27,7 +27,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -37,7 +37,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff, static int lp873x_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/lp87565.c b/drivers/power/pmic/lp87565.c index 782a46c..506769e 100644 --- a/drivers/power/pmic/lp87565.c +++ b/drivers/power/pmic/lp87565.c @@ -29,7 +29,7 @@ static int lp87565_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -40,7 +40,7 @@ static int lp87565_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/max77686.c b/drivers/power/pmic/max77686.c index ceca9f9..b3ed849 100644 --- a/drivers/power/pmic/max77686.c +++ b/drivers/power/pmic/max77686.c @@ -31,7 +31,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -41,7 +41,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff, static int max77686_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/max8997.c b/drivers/power/pmic/max8997.c index f749d7d..5ebeb8a 100644 --- a/drivers/power/pmic/max8997.c +++ b/drivers/power/pmic/max8997.c @@ -26,7 +26,7 @@ static int max8997_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -37,7 +37,7 @@ static int max8997_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/max8998.c b/drivers/power/pmic/max8998.c index 7c4773c..a7e0469 100644 --- a/drivers/power/pmic/max8998.c +++ b/drivers/power/pmic/max8998.c @@ -26,7 +26,7 @@ static int max8998_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -37,7 +37,7 @@ static int max8998_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/palmas.c b/drivers/power/pmic/palmas.c index 804c0d1..1e1ecb3 100644 --- a/drivers/power/pmic/palmas.c +++ b/drivers/power/pmic/palmas.c @@ -27,7 +27,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -37,7 +37,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff, static int palmas_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c index 5f361c7..a06cbc0 100644 --- a/drivers/power/pmic/pfuze100.c +++ b/drivers/power/pmic/pfuze100.c @@ -33,7 +33,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -43,7 +43,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff, static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/s2mps11.c b/drivers/power/pmic/s2mps11.c index 9d83059..522105e 100644 --- a/drivers/power/pmic/s2mps11.c +++ b/drivers/power/pmic/s2mps11.c @@ -27,7 +27,7 @@ static int s2mps11_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -38,7 +38,7 @@ static int s2mps11_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/s5m8767.c b/drivers/power/pmic/s5m8767.c index f8ae5ea..3812e24 100644 --- a/drivers/power/pmic/s5m8767.c +++ b/drivers/power/pmic/s5m8767.c @@ -30,7 +30,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -40,7 +40,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff, static int s5m8767_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/sandbox.c b/drivers/power/pmic/sandbox.c index 6763303..e8d6fac 100644 --- a/drivers/power/pmic/sandbox.c +++ b/drivers/power/pmic/sandbox.c @@ -31,7 +31,7 @@ static int sandbox_pmic_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -42,7 +42,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } @@ -52,7 +52,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg, static int sandbox_pmic_bind(struct udevice *dev) { if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info)) - error("%s:%d PMIC: %s - no child found!", __func__, __LINE__, + pr_err("%s:%d PMIC: %s - no child found!", __func__, __LINE__, dev->name); /* Always return success for this device - allows for PMIC I/O */ diff --git a/drivers/power/pmic/tps65090.c b/drivers/power/pmic/tps65090.c index 4565e3b..ee5358b 100644 --- a/drivers/power/pmic/tps65090.c +++ b/drivers/power/pmic/tps65090.c @@ -29,7 +29,7 @@ static int tps65090_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -42,7 +42,7 @@ static int tps65090_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) { - error("read error %d from device: %p register: %#x!", ret, dev, + pr_err("read error %d from device: %p register: %#x!", ret, dev, reg); return -EIO; } diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c index 35c2922..97b4a98 100644 --- a/drivers/power/regulator/fixed.c +++ b/drivers/power/regulator/fixed.c @@ -117,7 +117,7 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable) ret = dm_gpio_set_value(&dev_pdata->gpio, enable); if (ret) { - error("Can't set regulator : %s gpio to: %d\n", dev->name, + pr_err("Can't set regulator : %s gpio to: %d\n", dev->name, enable); return ret; } diff --git a/drivers/power/regulator/gpio-regulator.c b/drivers/power/regulator/gpio-regulator.c index 42391c6..1031a03 100644 --- a/drivers/power/regulator/gpio-regulator.c +++ b/drivers/power/regulator/gpio-regulator.c @@ -109,7 +109,7 @@ static int gpio_regulator_set_value(struct udevice *dev, int uV) ret = dm_gpio_set_value(&dev_pdata->gpio, enable); if (ret) { - error("Can't set regulator : %s gpio to: %d\n", dev->name, + pr_err("Can't set regulator : %s gpio to: %d\n", dev->name, enable); return ret; } diff --git a/drivers/power/regulator/max77686.c b/drivers/power/regulator/max77686.c index 8780806..2212d36 100644 --- a/drivers/power/regulator/max77686.c +++ b/drivers/power/regulator/max77686.c @@ -98,7 +98,7 @@ static int max77686_buck_volt2hex(int buck, int uV) if (hex >= 0 && hex <= hex_max) return hex; - error("Value: %d uV is wrong for BUCK%d", uV, buck); + pr_err("Value: %d uV is wrong for BUCK%d", uV, buck); return -EINVAL; } @@ -134,7 +134,7 @@ static int max77686_buck_hex2volt(int buck, int hex) return uV; bad_hex: - error("Value: %#x is wrong for BUCK%d", hex, buck); + pr_err("Value: %#x is wrong for BUCK%d", hex, buck); return -EINVAL; } @@ -160,7 +160,7 @@ static int max77686_ldo_volt2hex(int ldo, int uV) if (hex >= 0 && hex <= MAX77686_LDO_VOLT_MAX_HEX) return hex; - error("Value: %d uV is wrong for LDO%d", uV, ldo); + pr_err("Value: %d uV is wrong for LDO%d", uV, ldo); return -EINVAL; } @@ -189,7 +189,7 @@ static int max77686_ldo_hex2volt(int ldo, int hex) return uV; bad_hex: - error("Value: %#x is wrong for ldo%d", hex, ldo); + pr_err("Value: %#x is wrong for ldo%d", hex, ldo); return -EINVAL; } @@ -328,7 +328,7 @@ static int max77686_ldo_val(struct udevice *dev, int op, int *uV) ldo = dev->driver_data; if (ldo < 1 || ldo > MAX77686_LDO_NUM) { - error("Wrong ldo number: %d", ldo); + pr_err("Wrong ldo number: %d", ldo); return -EINVAL; } @@ -366,7 +366,7 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV) buck = dev->driver_data; if (buck < 1 || buck > MAX77686_BUCK_NUM) { - error("Wrong buck number: %d", buck); + pr_err("Wrong buck number: %d", buck); return -EINVAL; } @@ -423,7 +423,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode) ldo = dev->driver_data; if (ldo < 1 || ldo > MAX77686_LDO_NUM) { - error("Wrong ldo number: %d", ldo); + pr_err("Wrong ldo number: %d", ldo); return -EINVAL; } @@ -493,7 +493,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode) } if (mode == 0xff) { - error("Wrong mode: %d for ldo%d", *opmode, ldo); + pr_err("Wrong mode: %d for ldo%d", *opmode, ldo); return -EINVAL; } @@ -545,7 +545,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode) buck = dev->driver_data; if (buck < 1 || buck > MAX77686_BUCK_NUM) { - error("Wrong buck number: %d", buck); + pr_err("Wrong buck number: %d", buck); return -EINVAL; } @@ -614,7 +614,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode) } if (mode == 0xff) { - error("Wrong mode: %d for buck: %d\n", *opmode, buck); + pr_err("Wrong mode: %d for buck: %d\n", *opmode, buck); return -EINVAL; } diff --git a/drivers/power/regulator/pbias_regulator.c b/drivers/power/regulator/pbias_regulator.c index 914500b..116b7f4 100644 --- a/drivers/power/regulator/pbias_regulator.c +++ b/drivers/power/regulator/pbias_regulator.c @@ -70,14 +70,14 @@ static int pbias_ofdata_to_platdata(struct udevice *dev) err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "syscon", &syscon); if (err) { - error("%s: unable to find syscon device (%d)\n", __func__, + pr_err("%s: unable to find syscon device (%d)\n", __func__, err); return err; } regmap = syscon_get_regmap(syscon); if (IS_ERR(regmap)) { - error("%s: unable to find regmap (%ld)\n", __func__, + pr_err("%s: unable to find regmap (%ld)\n", __func__, PTR_ERR(regmap)); return PTR_ERR(regmap); } @@ -85,7 +85,7 @@ static int pbias_ofdata_to_platdata(struct udevice *dev) err = dev_read_resource(dev, 0, &res); if (err) { - error("%s: unable to find offset (%d)\n", __func__, err); + pr_err("%s: unable to find offset (%d)\n", __func__, err); return err; } priv->offset = res.start; diff --git a/drivers/power/regulator/sandbox.c b/drivers/power/regulator/sandbox.c index 06c09fd..f980a17 100644 --- a/drivers/power/regulator/sandbox.c +++ b/drivers/power/regulator/sandbox.c @@ -87,7 +87,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type, int ret; if (dev->driver_data > output_count) { - error("Unknown regulator number: %lu for PMIC %s!", + pr_err("Unknown regulator number: %lu for PMIC %s!", dev->driver_data, dev->name); return -EINVAL; } @@ -95,7 +95,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type, reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type; ret = pmic_read(dev->parent, reg, ®_val, 1); if (ret) { - error("PMIC read failed: %d\n", ret); + pr_err("PMIC read failed: %d\n", ret); return ret; } @@ -115,14 +115,14 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type, int max_value; if (dev->driver_data > output_count) { - error("Unknown regulator number: %lu for PMIC %s!", + pr_err("Unknown regulator number: %lu for PMIC %s!", dev->driver_data, dev->name); return -EINVAL; } max_value = range[dev->driver_data - 1].max; if (value > max_value) { - error("Wrong value for %s: %lu. Max is: %d.", + pr_err("Wrong value for %s: %lu. Max is: %d.", dev->name, dev->driver_data, max_value); return -EINVAL; } @@ -134,7 +134,7 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type, reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type; ret = pmic_write(dev->parent, reg, ®_val, 1); if (ret) { - error("PMIC write failed: %d\n", ret); + pr_err("PMIC write failed: %d\n", ret); return ret; } @@ -154,7 +154,7 @@ static int out_get_mode(struct udevice *dev) reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM; ret = pmic_read(dev->parent, reg, ®_val, 1); if (ret) { - error("PMIC read failed: %d\n", ret); + pr_err("PMIC read failed: %d\n", ret); return ret; } @@ -163,7 +163,7 @@ static int out_get_mode(struct udevice *dev) return uc_pdata->mode[i].id; } - error("Unknown operation mode for %s!", dev->name); + pr_err("Unknown operation mode for %s!", dev->name); return -EINVAL; } @@ -188,14 +188,14 @@ static int out_set_mode(struct udevice *dev, int mode) } if (reg_val == -1) { - error("Unknown operation mode for %s!", dev->name); + pr_err("Unknown operation mode for %s!", dev->name); return -EINVAL; } reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM; ret = pmic_write(dev->parent, reg, (uint8_t *)®_val, 1); if (ret) { - error("PMIC write failed: %d\n", ret); + pr_err("PMIC write failed: %d\n", ret); return ret; } -- cgit v1.1