From: Eugen.Hristev at microchip.com <Eugen.Hristev@microchip.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] w1-eeprom: ds24xxx: fix data abort in ds24xxx_probe()
Date: Tue, 23 Oct 2018 06:51:59 +0000 [thread overview]
Message-ID: <7f3a45a8-62e5-e0d0-ea7f-83f25bde7f89@microchip.com> (raw)
In-Reply-To: <1540225879-17841-1-git-send-email-martin.fuzzey@flowbird.group>
On 22.10.2018 19:31, Martin Fuzzey wrote:
> 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>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
Hi Martin,
At some point during development I switched from holding the data in
platdata to parent platdata, and this slipped.
Thanks for the fix.
Eugen
> ---
> 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;
> }
>
next prev parent reply other threads:[~2018-10-23 6:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Eugen.Hristev at microchip.com [this message]
2018-11-02 20:29 ` [U-Boot] w1-eeprom: ds24xxx: fix data abort in ds24xxx_probe() Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f3a45a8-62e5-e0d0-ea7f-83f25bde7f89@microchip.com \
--to=eugen.hristev@microchip.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox