Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

eeprom: at24: Improve confusing log message

Currently when binding to an spd EEPROM, the at24 drivers logs the
following message:

256 byte spd EEPROM, read-only, 0 bytes/write

The last part is confusing, as by definition you don't write to a
read-only EEPROM, plus "0 bytes/write" makes no sense whatsoever.

I propose to have a different message for read-only EEPROMs, which
does not include this last part.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

authored by

Jean Delvare and committed by
Bartosz Golaszewski
285be87c 54ecb8f7

+6 -3
+6 -3
drivers/misc/eeprom/at24.c
··· 716 716 return -ENODEV; 717 717 } 718 718 719 - dev_info(dev, "%u byte %s EEPROM, %s, %u bytes/write\n", 720 - byte_len, client->name, 721 - writable ? "writable" : "read-only", at24->write_max); 719 + if (writable) 720 + dev_info(dev, "%u byte %s EEPROM, writable, %u bytes/write\n", 721 + byte_len, client->name, at24->write_max); 722 + else 723 + dev_info(dev, "%u byte %s EEPROM, read-only\n", 724 + byte_len, client->name); 722 725 723 726 return 0; 724 727 }