rtc: remove superfluous error message

The RTC core now has error messages in case of registration failure, there
is no need to have other messages in the drivers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20190818220041.17833-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Alexandre Belloni 2019-08-19 00:00:41 +02:00
Родитель 924068e50a
Коммит 44c638ce4e
21 изменённых файлов: 31 добавлений и 106 удалений

Просмотреть файл

@ -295,10 +295,9 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
info->rtc_dev->range_max = U32_MAX;
ret = rtc_register_device(info->rtc_dev);
if (ret) {
dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
if (ret)
goto out_rtc;
}
/*
* enable internal XO instead of internal 3.25MHz clock since it can
* free running in PMIC power-down state.

Просмотреть файл

@ -390,35 +390,31 @@ static int abeoz9_probe(struct i2c_client *client,
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C |
I2C_FUNC_SMBUS_BYTE_DATA |
I2C_FUNC_SMBUS_I2C_BLOCK)) {
ret = -ENODEV;
goto err;
}
I2C_FUNC_SMBUS_I2C_BLOCK))
return -ENODEV;
regmap = devm_regmap_init_i2c(client, &abeoz9_rtc_regmap_config);
if (IS_ERR(regmap)) {
ret = PTR_ERR(regmap);
dev_err(dev, "regmap allocation failed: %d\n", ret);
goto err;
return ret;
}
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data) {
ret = -ENOMEM;
goto err;
}
if (!data)
return -ENOMEM;
data->regmap = regmap;
dev_set_drvdata(dev, data);
ret = abeoz9_rtc_setup(dev, client->dev.of_node);
if (ret)
goto err;
return ret;
data->rtc = devm_rtc_allocate_device(dev);
ret = PTR_ERR_OR_ZERO(data->rtc);
if (ret)
goto err;
return ret;
data->rtc->ops = &rtc_ops;
data->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
@ -426,14 +422,10 @@ static int abeoz9_probe(struct i2c_client *client,
ret = rtc_register_device(data->rtc);
if (ret)
goto err;
return ret;
abeoz9_hwmon_register(dev, data);
return 0;
err:
dev_err(dev, "unable to register RTC device (%d)\n", ret);
return ret;
}
#ifdef CONFIG_OF

Просмотреть файл

@ -610,15 +610,7 @@ static int ac100_rtc_probe(struct platform_device *pdev)
if (ret)
return ret;
ret = rtc_register_device(chip->rtc);
if (ret) {
dev_err(&pdev->dev, "unable to register device\n");
return ret;
}
dev_info(&pdev->dev, "RTC enabled\n");
return 0;
return rtc_register_device(chip->rtc);
}
static int ac100_rtc_remove(struct platform_device *pdev)

Просмотреть файл

@ -502,7 +502,6 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)
struct resource *res;
struct armada38x_rtc *rtc;
const struct of_device_id *match;
int ret;
match = of_match_device(armada38x_rtc_of_match_table, &pdev->dev);
if (!match)
@ -561,11 +560,7 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)
rtc->rtc_dev->range_max = U32_MAX;
ret = rtc_register_device(rtc->rtc_dev);
if (ret)
dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
return ret;
return rtc_register_device(rtc->rtc_dev);
}
#ifdef CONFIG_PM_SLEEP

Просмотреть файл

@ -86,7 +86,6 @@ static int aspeed_rtc_probe(struct platform_device *pdev)
{
struct aspeed_rtc *rtc;
struct resource *res;
int ret;
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
if (!rtc)
@ -107,11 +106,7 @@ static int aspeed_rtc_probe(struct platform_device *pdev)
rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
rtc->rtc_dev->range_max = 38814989399LL; /* 3199-12-31 23:59:59 */
ret = rtc_register_device(rtc->rtc_dev);
if (ret)
return ret;
return 0;
return rtc_register_device(rtc->rtc_dev);
}
static const struct of_device_id aspeed_rtc_match[] = {

Просмотреть файл

@ -476,11 +476,7 @@ static int bd70528_probe(struct platform_device *pdev)
return ret;
}
ret = rtc_register_device(rtc);
if (ret)
dev_err(&pdev->dev, "Registering RTC failed\n");
return ret;
return rtc_register_device(rtc);
}
static struct platform_driver bd70528_rtc = {

Просмотреть файл

@ -255,10 +255,8 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev)
timer->rtc->range_max = U32_MAX;
ret = rtc_register_device(timer->rtc);
if (ret) {
dev_err(dev, "unable to register device\n");
if (ret)
goto err_notifier;
}
dev_info(dev, "registered, with irq %d\n", timer->irq);

Просмотреть файл

@ -289,12 +289,8 @@ static int cdns_rtc_probe(struct platform_device *pdev)
}
crtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(crtc->rtc_dev)) {
ret = PTR_ERR(crtc->rtc_dev);
dev_err(&pdev->dev,
"Failed to allocate the RTC device, %d\n", ret);
return ret;
}
if (IS_ERR(crtc->rtc_dev))
return PTR_ERR(crtc->rtc_dev);
platform_set_drvdata(pdev, crtc);
@ -343,11 +339,8 @@ static int cdns_rtc_probe(struct platform_device *pdev)
writel(CDNS_RTC_KRTCR_KRTC, crtc->regs + CDNS_RTC_KRTCR);
ret = rtc_register_device(crtc->rtc_dev);
if (ret) {
dev_err(&pdev->dev,
"Failed to register the RTC device, %d\n", ret);
if (ret)
goto err_disable_wakeup;
}
return 0;

Просмотреть файл

@ -690,19 +690,16 @@ static int ds1305_probe(struct spi_device *spi)
/* register RTC ... from here on, ds1305->ctrl needs locking */
ds1305->rtc = devm_rtc_allocate_device(&spi->dev);
if (IS_ERR(ds1305->rtc)) {
if (IS_ERR(ds1305->rtc))
return PTR_ERR(ds1305->rtc);
}
ds1305->rtc->ops = &ds1305_ops;
ds1305_nvmem_cfg.priv = ds1305;
ds1305->rtc->nvram_old_abi = true;
status = rtc_register_device(ds1305->rtc);
if (status) {
dev_dbg(&spi->dev, "register rtc --> %d\n", status);
if (status)
return status;
}
rtc_nvmem_register(ds1305->rtc, &ds1305_nvmem_cfg);

Просмотреть файл

@ -167,10 +167,8 @@ static int imx_sc_rtc_probe(struct platform_device *pdev)
imx_sc_rtc->range_max = U32_MAX;
ret = rtc_register_device(imx_sc_rtc);
if (ret) {
dev_err(&pdev->dev, "failed to register rtc: %d\n", ret);
if (ret)
return ret;
}
imx_scu_irq_register_notifier(&imx_sc_rtc_alarm_sc_notifier);

Просмотреть файл

@ -360,10 +360,8 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
rtc->rtc->range_max = U32_MAX;
ret = rtc_register_device(rtc->rtc);
if (ret) {
dev_err(&pdev->dev, "Failed to register rtc device: %d\n", ret);
if (ret)
return ret;
}
ret = devm_request_irq(&pdev->dev, rtc->irq, jz4740_rtc_irq, 0,
pdev->name, rtc);

Просмотреть файл

@ -343,10 +343,8 @@ static int mtk_rtc_probe(struct platform_device *pdev)
rtc->rtc_dev->ops = &mtk_rtc_ops;
ret = rtc_register_device(rtc->rtc_dev);
if (ret) {
dev_err(&pdev->dev, "register rtc device failed\n");
if (ret)
goto out_free_irq;
}
return 0;

Просмотреть файл

@ -235,10 +235,8 @@ static int puv3_rtc_probe(struct platform_device *pdev)
/* register RTC and exit */
rtc->ops = &puv3_rtcops;
ret = rtc_register_device(rtc);
if (ret) {
dev_err(&pdev->dev, "cannot attach rtc\n");
if (ret)
goto err_nortc;
}
/* platform setup code should have handled this; sigh */
if (!device_can_wakeup(&pdev->dev))

Просмотреть файл

@ -639,9 +639,8 @@ static int rv3028_probe(struct i2c_client *client)
dev_warn(&client->dev, "An alarm may have been missed.\n");
rv3028->rtc = devm_rtc_allocate_device(&client->dev);
if (IS_ERR(rv3028->rtc)) {
if (IS_ERR(rv3028->rtc))
return PTR_ERR(rv3028->rtc);
}
if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq,

Просмотреть файл

@ -564,9 +564,8 @@ static int rv8803_probe(struct i2c_client *client,
dev_warn(&client->dev, "An alarm maybe have been missed.\n");
rv8803->rtc = devm_rtc_allocate_device(&client->dev);
if (IS_ERR(rv8803->rtc)) {
if (IS_ERR(rv8803->rtc))
return PTR_ERR(rv8803->rtc);
}
if (client->irq > 0) {
err = devm_request_threaded_irq(&client->dev, client->irq,

Просмотреть файл

@ -654,7 +654,6 @@ static int sprd_rtc_probe(struct platform_device *pdev)
rtc->rtc->range_max = 5662310399LL;
ret = rtc_register_device(rtc->rtc);
if (ret) {
dev_err(&pdev->dev, "failed to register rtc device\n");
device_init_wakeup(&pdev->dev, 0);
return ret;
}

Просмотреть файл

@ -193,10 +193,8 @@ static int sd3078_probe(struct i2c_client *client,
sd3078->rtc->range_max = RTC_TIMESTAMP_END_2099;
ret = rtc_register_device(sd3078->rtc);
if (ret) {
dev_err(&client->dev, "failed to register rtc device\n");
if (ret)
return ret;
}
sd3078_enable_reg_write(sd3078);

Просмотреть файл

@ -472,15 +472,7 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
chip->rtc->ops = &sunxi_rtc_ops;
ret = rtc_register_device(chip->rtc);
if (ret) {
dev_err(&pdev->dev, "unable to register device\n");
return ret;
}
dev_info(&pdev->dev, "RTC enabled\n");
return 0;
return rtc_register_device(chip->rtc);
}
static struct platform_driver sunxi_rtc_driver = {

Просмотреть файл

@ -332,10 +332,8 @@ static int tegra_rtc_probe(struct platform_device *pdev)
}
ret = rtc_register_device(info->rtc);
if (ret) {
dev_err(&pdev->dev, "failed to register device: %d\n", ret);
if (ret)
goto disable_clk;
}
dev_notice(&pdev->dev, "Tegra internal Real Time Clock\n");

Просмотреть файл

@ -259,7 +259,6 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc->rtc)) {
ret = PTR_ERR(rtc->rtc);
dev_err(&pdev->dev, "RTC allocate device: ret %d\n", ret);
goto fail_rtc_register;
}
@ -280,10 +279,8 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
disable_irq(rtc->irq);
ret = rtc_register_device(rtc->rtc);
if (ret) {
dev_err(&pdev->dev, "RTC device register: ret %d\n", ret);
if (ret)
goto fail_rtc_register;
}
return 0;

Просмотреть файл

@ -425,13 +425,7 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
tps_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
tps_rtc->rtc->range_max = RTC_TIMESTAMP_END_2099;
ret = rtc_register_device(tps_rtc->rtc);
if (ret) {
dev_err(&pdev->dev, "RTC device register: err %d\n", ret);
return ret;
}
return 0;
return rtc_register_device(tps_rtc->rtc);
}
#ifdef CONFIG_PM_SLEEP