]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/i2c/i2c-stub.c
dell_rbu.txt: standardize document format
[karo-tx-linux.git] / drivers / i2c / i2c-stub.c
index 06af583d510150c4e8086202005fc1e46e6d6663..4a9ad91c5ba3eaf2d2e396d69e6076c0cdc1ec17 100644 (file)
@@ -16,6 +16,7 @@
 */
 
 #define DEBUG 1
+#define pr_fmt(fmt) "i2c-stub: " fmt
 
 #include <linux/errno.h>
 #include <linux/i2c.h>
@@ -342,7 +343,7 @@ static int __init i2c_stub_allocate_banks(int i)
        if (!chip->bank_words)
                return -ENOMEM;
 
-       pr_debug("i2c-stub: Allocated %u banks of %u words each (registers 0x%02x to 0x%02x)\n",
+       pr_debug("Allocated %u banks of %u words each (registers 0x%02x to 0x%02x)\n",
                 chip->bank_mask, chip->bank_size, chip->bank_start,
                 chip->bank_end);
 
@@ -363,28 +364,27 @@ static int __init i2c_stub_init(void)
        int i, ret;
 
        if (!chip_addr[0]) {
-               pr_err("i2c-stub: Please specify a chip address\n");
+               pr_err("Please specify a chip address\n");
                return -ENODEV;
        }
 
        for (i = 0; i < MAX_CHIPS && chip_addr[i]; i++) {
                if (chip_addr[i] < 0x03 || chip_addr[i] > 0x77) {
-                       pr_err("i2c-stub: Invalid chip address 0x%02x\n",
+                       pr_err("Invalid chip address 0x%02x\n",
                               chip_addr[i]);
                        return -EINVAL;
                }
 
-               pr_info("i2c-stub: Virtual chip at 0x%02x\n", chip_addr[i]);
+               pr_info("Virtual chip at 0x%02x\n", chip_addr[i]);
        }
 
        /* Allocate memory for all chips at once */
        stub_chips_nr = i;
        stub_chips = kcalloc(stub_chips_nr, sizeof(struct stub_chip),
                             GFP_KERNEL);
-       if (!stub_chips) {
-               pr_err("i2c-stub: Out of memory\n");
+       if (!stub_chips)
                return -ENOMEM;
-       }
+
        for (i = 0; i < stub_chips_nr; i++) {
                INIT_LIST_HEAD(&stub_chips[i].smbus_blocks);