Skip to content

Commit

Permalink
rtc: max77686: Cleanup and reduce dmesg output
Browse files Browse the repository at this point in the history
Cleanup of entire driver of its dmesg output:
1. Remove printing of the function name, because printing device name is
   sufficient. This also makes the dev_err()-like functions more compact
   and readable (not need of line break).
2. Lower from info to debug printing of each RTC interrupt (no need to
   make noise on each alarm).
3. Remove dev_info() at beginning of probe because a message is already
   always printed by either probe failure or from registering the RTC
   device as /dev/rtcX.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
Krzysztof Kozlowski authored and Alexandre Belloni committed Feb 4, 2016
1 parent cd0e7c1 commit bf035f4
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions drivers/rtc/rtc-max77686.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ static int max77686_rtc_update(struct max77686_rtc_info *info,
info->drv_data->map[REG_RTC_UPDATE0],
data, data);
if (ret < 0)
dev_err(info->dev, "%s: fail to write update reg(ret=%d, data=0x%x)\n",
__func__, ret, data);
dev_err(info->dev, "Fail to write update reg(ret=%d, data=0x%x)\n",
ret, data);
else {
/* Minimum delay required before RTC update. */
usleep_range(delay, delay * 2);
Expand All @@ -297,7 +297,7 @@ static int max77686_rtc_read_time(struct device *dev, struct rtc_time *tm)
info->drv_data->map[REG_RTC_SEC],
data, ARRAY_SIZE(data));
if (ret < 0) {
dev_err(info->dev, "%s: fail to read time reg(%d)\n", __func__, ret);
dev_err(info->dev, "Fail to read time reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -326,8 +326,7 @@ static int max77686_rtc_set_time(struct device *dev, struct rtc_time *tm)
info->drv_data->map[REG_RTC_SEC],
data, ARRAY_SIZE(data));
if (ret < 0) {
dev_err(info->dev, "%s: fail to write time reg(%d)\n", __func__,
ret);
dev_err(info->dev, "Fail to write time reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -355,8 +354,7 @@ static int max77686_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
ret = regmap_bulk_read(info->max77686->rtc_regmap,
map[REG_ALARM1_SEC], data, ARRAY_SIZE(data));
if (ret < 0) {
dev_err(info->dev, "%s:%d fail to read alarm reg(%d)\n",
__func__, __LINE__, ret);
dev_err(info->dev, "Fail to read alarm reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -394,8 +392,7 @@ static int max77686_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->pending = 0;
ret = regmap_read(info->max77686->regmap, MAX77686_REG_STATUS2, &val);
if (ret < 0) {
dev_err(info->dev, "%s:%d fail to read status2 reg(%d)\n",
__func__, __LINE__, ret);
dev_err(info->dev, "Fail to read status2 reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -435,8 +432,7 @@ static int max77686_rtc_stop_alarm(struct max77686_rtc_info *info)
map[REG_ALARM1_SEC], data,
ARRAY_SIZE(data));
if (ret < 0) {
dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
__func__, ret);
dev_err(info->dev, "Fail to read alarm reg(%d)\n", ret);
goto out;
}

Expand All @@ -451,8 +447,7 @@ static int max77686_rtc_stop_alarm(struct max77686_rtc_info *info)
}

if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
__func__, ret);
dev_err(info->dev, "Fail to write alarm reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -483,8 +478,7 @@ static int max77686_rtc_start_alarm(struct max77686_rtc_info *info)
map[REG_ALARM1_SEC], data,
ARRAY_SIZE(data));
if (ret < 0) {
dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
__func__, ret);
dev_err(info->dev, "Fail to read alarm reg(%d)\n", ret);
goto out;
}

Expand All @@ -507,8 +501,7 @@ static int max77686_rtc_start_alarm(struct max77686_rtc_info *info)
}

if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
__func__, ret);
dev_err(info->dev, "Fail to write alarm reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -538,8 +531,7 @@ static int max77686_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
data, ARRAY_SIZE(data));

if (ret < 0) {
dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
__func__, ret);
dev_err(info->dev, "Fail to write alarm reg(%d)\n", ret);
goto out;
}

Expand Down Expand Up @@ -574,7 +566,7 @@ static irqreturn_t max77686_rtc_alarm_irq(int irq, void *data)
{
struct max77686_rtc_info *info = data;

dev_info(info->dev, "%s:irq(%d)\n", __func__, irq);
dev_dbg(info->dev, "RTC alarm IRQ: %d\n", irq);

rtc_update_irq(info->rtc_dev, 1, RTC_IRQF | RTC_AF);

Expand Down Expand Up @@ -604,8 +596,7 @@ static int max77686_rtc_init_reg(struct max77686_rtc_info *info)
info->drv_data->map[REG_RTC_CONTROLM],
data, ARRAY_SIZE(data));
if (ret < 0) {
dev_err(info->dev, "%s: fail to write controlm reg(%d)\n",
__func__, ret);
dev_err(info->dev, "Fail to write controlm reg(%d)\n", ret);
return ret;
}

Expand All @@ -620,8 +611,6 @@ static int max77686_rtc_probe(struct platform_device *pdev)
const struct platform_device_id *id = platform_get_device_id(pdev);
int ret;

dev_info(&pdev->dev, "%s\n", __func__);

info = devm_kzalloc(&pdev->dev, sizeof(struct max77686_rtc_info),
GFP_KERNEL);
if (!info)
Expand Down Expand Up @@ -661,7 +650,7 @@ static int max77686_rtc_probe(struct platform_device *pdev)

if (!max77686->rtc_irq_data) {
ret = -EINVAL;
dev_err(&pdev->dev, "%s: no RTC regmap IRQ chip\n", __func__);
dev_err(&pdev->dev, "No RTC regmap IRQ chip\n");
goto err_rtc;
}

Expand Down

0 comments on commit bf035f4

Please sign in to comment.