U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] w1-eeprom: ds24xxx: fix data abort in ds24xxx_probe()
@ 2018-10-22 16:31 Martin Fuzzey
  2018-10-22 16:31 ` [U-Boot] [PATCH] w1: fix data abort if no one wire bus master present Martin Fuzzey
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Martin Fuzzey @ 2018-10-22 16:31 UTC (permalink / raw)
  To: u-boot

Data abort was occurring when using "w1 bus" with a DS24B33 present.

The abort occurred in the ds24xxx_probe() because the struct w1_device
pointer was NULL. This is because that structure  is allocated by
the parent device uclass (by .per_child_platdata_auto_alloc_size)
and thus the correct accessor is dev_get_parent_platdata() not
dev_get_platdata()

Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
---
 drivers/w1-eeprom/ds24xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1-eeprom/ds24xxx.c b/drivers/w1-eeprom/ds24xxx.c
index 56186e5..0967acc 100644
--- a/drivers/w1-eeprom/ds24xxx.c
+++ b/drivers/w1-eeprom/ds24xxx.c
@@ -31,7 +31,7 @@ static int ds24xxx_probe(struct udevice *dev)
 {
 	struct w1_device *w1;
 
-	w1 = dev_get_platdata(dev);
+	w1 = dev_get_parent_platdata(dev);
 	w1->id = 0;
 	return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-02 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-22 16:31 [U-Boot] [PATCH] w1-eeprom: ds24xxx: fix data abort in ds24xxx_probe() Martin Fuzzey
2018-10-22 16:31 ` [U-Boot] [PATCH] w1: fix data abort if no one wire bus master present Martin Fuzzey
2018-10-23  7:05   ` Eugen.Hristev at microchip.com
2018-10-23  8:17     ` Martin Fuzzey
2018-10-23  8:30       ` Eugen.Hristev at microchip.com
2018-11-02 20:29   ` [U-Boot] " Tom Rini
2018-10-23  6:51 ` [U-Boot] [PATCH] w1-eeprom: ds24xxx: fix data abort in ds24xxx_probe() Eugen.Hristev at microchip.com
2018-11-02 20:29 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox