Skip to contentSkip to conversation

ds1wm: report bus reset error

PATCH In review Anton Vorontsov 2 participants 2 messages Feb 25, 2008 – Feb 26, 2008 W1 dallas's 1-wire bus

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ds1wm: report bus reset error

The patch replaces dev_dbg() by dev_err(), so the user could actually see the error, instead of wondering why w1 doesn't work. The root cause of the bus reset error isn't yet debugged though, but this sometimes happens on iPaq H5555.

And while I'm at it, some cosmetic cleanups also made (few lines were using spaces instead of tabs).

---
 drivers/w1/masters/ds1wm.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/w1/masters/ds1wm.c +9 -9
index 78a14da..10211e4 100644
@@ -103,12 +103,12 @@ struct ds1wm_data {
 static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg,
 					u8 val)
 {
-        __raw_writeb(val, ds1wm_data->map + (reg << ds1wm_data->bus_shift));
+	__raw_writeb(val, ds1wm_data->map + (reg << ds1wm_data->bus_shift));
 }
 
 static inline u8 ds1wm_read_register(struct ds1wm_data *ds1wm_data, u32 reg)
 {
-        return __raw_readb(ds1wm_data->map + (reg << ds1wm_data->bus_shift));
+	return __raw_readb(ds1wm_data->map + (reg << ds1wm_data->bus_shift));
 }
 
 
@@ -150,8 +150,8 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
 	timeleft = wait_for_completion_timeout(&reset_done, DS1WM_TIMEOUT);
 	ds1wm_data->reset_complete = NULL;
 	if (!timeleft) {
-                dev_dbg(&ds1wm_data->pdev->dev, "reset failed\n");
-                return 1;
+		dev_err(&ds1wm_data->pdev->dev, "reset failed\n");
+		return 1;
 	}
 
 	/* Wait for the end of the reset. According to the specs, the time
@@ -168,11 +168,11 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
 		(ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0));
 
 	if (!ds1wm_data->slave_present) {
-                dev_dbg(&ds1wm_data->pdev->dev, "reset: no devices found\n");
-                return 1;
-        }
+		dev_dbg(&ds1wm_data->pdev->dev, "reset: no devices found\n");
+		return 1;
+	}
 
-        return 0;
+	return 0;
 }
 
 static int ds1wm_write(struct ds1wm_data *ds1wm_data, u8 data)
@@ -335,7 +335,7 @@ static int ds1wm_probe(struct platform_device *pdev)
 	if (!pdev)
 		return -ENODEV;
 
-	ds1wm_data = kzalloc(sizeof (*ds1wm_data), GFP_KERNEL);
+	ds1wm_data = kzalloc(sizeof(*ds1wm_data), GFP_KERNEL);
 	if (!ds1wm_data)
 		return -ENOMEM;
 
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 4 lines · Anton Vorontsov

The patch replaces dev_dbg() by dev_err(), so the user could actually see the error, instead of wondering why w1 doesn't work. The root cause of the bus reset error isn't yet debugged though, but this sometimes happens on iPaq H5555.

I'v been working on some of my own changes to the one wire system. I'll need some testers eventually, what slave devices does the iPaq have? What's the scheduler timer Hz on the iPaq?

I have the USB ds2490 device and ds18b20 temperature sensor. I've worked though deadlocks in the base driver, and I'm right now scratching my head on a USB bulk read and write timeout. I'm running it under qemu and I expect that is introducing some issues. I intend to patch it up when I get through that. Hardly any of the changes touch ds1wm, so we shouldn't be stomping on each other's feet.

Signature · 2 lines
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)