Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a737e835 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

rtc: use more standard kernel logging styles



Neaten the logging a bit by adding #define pr_fmt

Miscellanea:

o Remove __FILE__/__func__ uses
o Coalesce formats adding missing spaces
o Align arguments
o (rtc-cmos) Integrated 2 consecutive messages

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f539a8ac
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -9,6 +9,8 @@
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
*/
*/


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/rtc.h>
#include <linux/rtc.h>


/* IMPORTANT: the RTC only stores whole seconds. It is arbitrary
/* IMPORTANT: the RTC only stores whole seconds. It is arbitrary
@@ -32,8 +34,8 @@ static int __init rtc_hctosys(void)
	struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
	struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);


	if (rtc == NULL) {
	if (rtc == NULL) {
		pr_info("%s: unable to open rtc device (%s)\n",
		pr_info("unable to open rtc device (%s)\n",
			__func__, CONFIG_RTC_HCTOSYS_DEVICE);
			CONFIG_RTC_HCTOSYS_DEVICE);
		goto err_open;
		goto err_open;
	}
	}


+4 −2
Original line number Original line Diff line number Diff line
@@ -28,6 +28,9 @@
 * interrupts disabled, holding the global rtc_lock, to exclude those
 * interrupts disabled, holding the global rtc_lock, to exclude those
 * other drivers and utilities on correctly configured systems.
 * other drivers and utilities on correctly configured systems.
 */
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
@@ -385,8 +388,7 @@ static bool alarm_disable_quirk;
static int __init set_alarm_disable_quirk(const struct dmi_system_id *id)
static int __init set_alarm_disable_quirk(const struct dmi_system_id *id)
{
{
	alarm_disable_quirk = true;
	alarm_disable_quirk = true;
	pr_info("rtc-cmos: BIOS has alarm-disable quirk. ");
	pr_info("BIOS has alarm-disable quirk - RTC alarms disabled\n");
	pr_info("RTC alarms disabled\n");
	return 0;
	return 0;
}
}


+5 −3
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@
 * "Sending and receiving", using SMBus level communication is preferred.
 * "Sending and receiving", using SMBus level communication is preferred.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
@@ -406,7 +408,7 @@ static int ds1374_wdt_settimeout(unsigned int timeout)
	/* Set new watchdog time */
	/* Set new watchdog time */
	ret = ds1374_write_rtc(save_client, timeout, DS1374_REG_WDALM0, 3);
	ret = ds1374_write_rtc(save_client, timeout, DS1374_REG_WDALM0, 3);
	if (ret) {
	if (ret) {
		pr_info("rtc-ds1374 - couldn't set new watchdog time\n");
		pr_info("couldn't set new watchdog time\n");
		goto out;
		goto out;
	}
	}


@@ -539,12 +541,12 @@ static long ds1374_wdt_ioctl(struct file *file, unsigned int cmd,
			return -EFAULT;
			return -EFAULT;


		if (options & WDIOS_DISABLECARD) {
		if (options & WDIOS_DISABLECARD) {
			pr_info("rtc-ds1374: disable watchdog\n");
			pr_info("disable watchdog\n");
			ds1374_wdt_disable();
			ds1374_wdt_disable();
		}
		}


		if (options & WDIOS_ENABLECARD) {
		if (options & WDIOS_ENABLECARD) {
			pr_info("rtc-ds1374: enable watchdog\n");
			pr_info("enable watchdog\n");
			ds1374_wdt_settimeout(wdt_margin);
			ds1374_wdt_settimeout(wdt_margin);
			ds1374_wdt_ping();
			ds1374_wdt_ping();
		}
		}
+3 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/bcd.h>
#include <linux/bcd.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/io.h>
@@ -2182,7 +2184,7 @@ ds1685_rtc_poweroff(struct platform_device *pdev)


	/* Check for valid RTC data, else, spin forever. */
	/* Check for valid RTC data, else, spin forever. */
	if (unlikely(!pdev)) {
	if (unlikely(!pdev)) {
		pr_emerg("rtc-ds1685: platform device data not available, spinning forever ...\n");
		pr_emerg("platform device data not available, spinning forever ...\n");
		unreachable();
		unreachable();
	} else {
	} else {
		/* Get the rtc data. */
		/* Get the rtc data. */
+4 −2
Original line number Original line Diff line number Diff line
@@ -15,6 +15,8 @@
 * "Sending and receiving", using SMBus level communication is preferred.
 * "Sending and receiving", using SMBus level communication is preferred.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
@@ -373,8 +375,8 @@ static void ds3232_work(struct work_struct *work)
	if (stat & DS3232_REG_SR_A1F) {
	if (stat & DS3232_REG_SR_A1F) {
		control = i2c_smbus_read_byte_data(client, DS3232_REG_CR);
		control = i2c_smbus_read_byte_data(client, DS3232_REG_CR);
		if (control < 0) {
		if (control < 0) {
			pr_warn("Read DS3232 Control Register error."
			pr_warn("Read Control Register error - Disable IRQ%d\n",
				"Disable IRQ%d.\n", client->irq);
				client->irq);
		} else {
		} else {
			/* disable alarm1 interrupt */
			/* disable alarm1 interrupt */
			control &= ~(DS3232_REG_CR_A1IE);
			control &= ~(DS3232_REG_CR_A1IE);
Loading