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

Commit bc0495c4 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] tea5767: use module prefix on printed messages



use pr_fmt() & friends for error messages to output like:

[    9.651721] tea5767: Chip ID is not zero. It is not a TEA5767

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 36dba13b
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@
 * from their contributions on DScaler.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
@@ -370,17 +372,18 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
{
	struct tuner_i2c_props i2c = { .adap = i2c_adap, .addr = i2c_addr };
	unsigned char buffer[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

	int rc;

	if ((rc = tuner_i2c_xfer_recv(&i2c, buffer, 7))< 5) {
		printk(KERN_WARNING "It is not a TEA5767. Received %i bytes.\n", rc);
		pr_warn("It is not a TEA5767. Received %i bytes.\n", rc);
		return -EINVAL;
	}

	/* If all bytes are the same then it's a TV tuner and not a tea5767 */
	if (buffer[0] == buffer[1] && buffer[0] == buffer[2] &&
	    buffer[0] == buffer[3] && buffer[0] == buffer[4]) {
		printk(KERN_WARNING "All bytes are equal. It is not a TEA5767\n");
		pr_warn("All bytes are equal. It is not a TEA5767\n");
		return -EINVAL;
	}

@@ -390,7 +393,7 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
	 *  Byte 5: bit 7:0 : == 0
	 */
	if (((buffer[3] & 0x0f) != 0x00) || (buffer[4] != 0x00)) {
		printk(KERN_WARNING "Chip ID is not zero. It is not a TEA5767\n");
		pr_warn("Chip ID is not zero. It is not a TEA5767\n");
		return -EINVAL;
	}