Re: [PATCH] misc/eeprom/at24: init dynamic bin_attribute structures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram:

your patch completely fixes the issue on my 5200B board.

Just an other dumb question:  as I mentioned, the driver is loaded even if no chip is attached to the i2c bus.  Wouldn't it make sense to check if the chip is there (e.g. by reading the first byte), and eject with ENODEV if it isn't?

Thanks, Albrecht.

Tested-By: Albrecht Dreß <albrecht.dress@xxxxxxxx>

Am 11.03.10 01:55 schrieb(en) Wolfram Sang:
Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement.

Reported-by: Albrecht Dreß <albrecht.dress@xxxxxxxx>
Signed-off-by: Wolfram Sang <w.sang@xxxxxxxxxxxxxx>
Cc: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Cc: Jean Delvare <khali@xxxxxxxxxxxx>
---
 drivers/misc/eeprom/at24.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Depends on:

http://thread.gmane.org/gmane.linux.drivers.i2c/5496

([PATCH V2] at24: Fall back to byte or word reads if needed)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 88c20da..d2deea4 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -541,6 +541,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	at24->bin.attr.mode = chip.flags & AT24_FLAG_IRUGO ? S_IRUGO : S_IRUSR;
 	at24->bin.read = at24_bin_read;
 	at24->bin.size = chip.byte_len;
+	sysfs_bin_attr_init(&at24->bin);

 	at24->macc.read = at24_macc_read;

--
1.7.0





Attachment: pgpQ3BCSnnxaC.pgp
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux