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

Commit a8ca1037 authored by Joe Perches's avatar Joe Perches Committed by Jean Delvare
Browse files

hwmon: (it87) Use pr_fmt and pr_<level>



Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 632bdb24
Loading
Loading
Loading
Loading
+14 −16
Original line number Original line Diff line number Diff line
@@ -38,6 +38,8 @@
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/slab.h>
@@ -1570,26 +1572,25 @@ static int __init it87_find(unsigned short *address,
	case 0xffff:	/* No device at all */
	case 0xffff:	/* No device at all */
		goto exit;
		goto exit;
	default:
	default:
		pr_debug(DRVNAME ": Unsupported chip (DEVID=0x%x)\n",
		pr_debug("Unsupported chip (DEVID=0x%x)\n", chip_type);
			 chip_type);
		goto exit;
		goto exit;
	}
	}


	superio_select(PME);
	superio_select(PME);
	if (!(superio_inb(IT87_ACT_REG) & 0x01)) {
	if (!(superio_inb(IT87_ACT_REG) & 0x01)) {
		pr_info("it87: Device not activated, skipping\n");
		pr_info("Device not activated, skipping\n");
		goto exit;
		goto exit;
	}
	}


	*address = superio_inw(IT87_BASE_REG) & ~(IT87_EXTENT - 1);
	*address = superio_inw(IT87_BASE_REG) & ~(IT87_EXTENT - 1);
	if (*address == 0) {
	if (*address == 0) {
		pr_info("it87: Base address not set, skipping\n");
		pr_info("Base address not set, skipping\n");
		goto exit;
		goto exit;
	}
	}


	err = 0;
	err = 0;
	sio_data->revision = superio_inb(DEVREV) & 0x0f;
	sio_data->revision = superio_inb(DEVREV) & 0x0f;
	pr_info("it87: Found IT%04xF chip at 0x%x, revision %d\n",
	pr_info("Found IT%04xF chip at 0x%x, revision %d\n",
		chip_type, *address, sio_data->revision);
		chip_type, *address, sio_data->revision);


	/* in8 (Vbat) is always internal */
	/* in8 (Vbat) is always internal */
@@ -1615,7 +1616,7 @@ static int __init it87_find(unsigned short *address,
		} else {
		} else {
			/* We need at least 4 VID pins */
			/* We need at least 4 VID pins */
			if (reg & 0x0f) {
			if (reg & 0x0f) {
				pr_info("it87: VID is disabled (pins used for GPIO)\n");
				pr_info("VID is disabled (pins used for GPIO)\n");
				sio_data->skip_vid = 1;
				sio_data->skip_vid = 1;
			}
			}
		}
		}
@@ -1651,7 +1652,7 @@ static int __init it87_find(unsigned short *address,
		if (sio_data->type == it8720 && !(reg & (1 << 1))) {
		if (sio_data->type == it8720 && !(reg & (1 << 1))) {
			reg |= (1 << 1);
			reg |= (1 << 1);
			superio_outb(IT87_SIO_PINX2_REG, reg);
			superio_outb(IT87_SIO_PINX2_REG, reg);
			pr_notice("it87: Routing internal VCCH to in7\n");
			pr_notice("Routing internal VCCH to in7\n");
		}
		}
		if (reg & (1 << 0))
		if (reg & (1 << 0))
			sio_data->internal |= (1 << 0);
			sio_data->internal |= (1 << 0);
@@ -1661,7 +1662,7 @@ static int __init it87_find(unsigned short *address,
		sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f;
		sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f;
	}
	}
	if (sio_data->beep_pin)
	if (sio_data->beep_pin)
		pr_info("it87: Beeping is supported\n");
		pr_info("Beeping is supported\n");


	/* Disable specific features based on DMI strings */
	/* Disable specific features based on DMI strings */
	board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
	board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
@@ -1675,8 +1676,7 @@ static int __init it87_find(unsigned short *address,
			   the PWM2 duty cycle, so we disable it.
			   the PWM2 duty cycle, so we disable it.
			   I use the board name string as the trigger in case
			   I use the board name string as the trigger in case
			   the same board is ever used in other systems. */
			   the same board is ever used in other systems. */
			pr_info("it87: Disabling pwm2 due to "
			pr_info("Disabling pwm2 due to hardware constraints\n");
				"hardware constraints\n");
			sio_data->skip_pwm = (1 << 1);
			sio_data->skip_pwm = (1 << 1);
		}
		}
	}
	}
@@ -2189,28 +2189,26 @@ static int __init it87_device_add(unsigned short address,
	pdev = platform_device_alloc(DRVNAME, address);
	pdev = platform_device_alloc(DRVNAME, address);
	if (!pdev) {
	if (!pdev) {
		err = -ENOMEM;
		err = -ENOMEM;
		printk(KERN_ERR DRVNAME ": Device allocation failed\n");
		pr_err("Device allocation failed\n");
		goto exit;
		goto exit;
	}
	}


	err = platform_device_add_resources(pdev, &res, 1);
	err = platform_device_add_resources(pdev, &res, 1);
	if (err) {
	if (err) {
		printk(KERN_ERR DRVNAME ": Device resource addition failed "
		pr_err("Device resource addition failed (%d)\n", err);
		       "(%d)\n", err);
		goto exit_device_put;
		goto exit_device_put;
	}
	}


	err = platform_device_add_data(pdev, sio_data,
	err = platform_device_add_data(pdev, sio_data,
				       sizeof(struct it87_sio_data));
				       sizeof(struct it87_sio_data));
	if (err) {
	if (err) {
		printk(KERN_ERR DRVNAME ": Platform data allocation failed\n");
		pr_err("Platform data allocation failed\n");
		goto exit_device_put;
		goto exit_device_put;
	}
	}


	err = platform_device_add(pdev);
	err = platform_device_add(pdev);
	if (err) {
	if (err) {
		printk(KERN_ERR DRVNAME ": Device addition failed (%d)\n",
		pr_err("Device addition failed (%d)\n", err);
		       err);
		goto exit_device_put;
		goto exit_device_put;
	}
	}