Commit 44c638ce authored by Alexandre Belloni's avatar Alexandre Belloni
Browse files

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: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20190818220041.17833-2-alexandre.belloni@bootlin.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 924068e5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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.
+8 −16
Original line number Diff line number Diff line
@@ -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
+1 −9
Original line number Diff line number Diff line
@@ -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)
+1 −6
Original line number Diff line number Diff line
@@ -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
+1 −6
Original line number Diff line number Diff line
@@ -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[] = {
Loading