* [PATCH] thermal: rcar_thermal: don't open code of_device_get_match_data()
@ 2016-03-01 16:38 Wolfram Sang
2016-03-02 9:07 ` Geert Uytterhoeven
0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2016-03-01 16:38 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Wolfram Sang, Zhang Rui, Eduardo Valentin, linux-pm
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
This change will also make Coverity happy by avoiding a theoretical NULL
pointer dereference; yet another reason is to use the above helper function
to tighten the code and make it more readable.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Tested on a Lager board.
drivers/thermal/rcar_thermal.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 0e735acea33afc..82daba09e1503a 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -430,8 +430,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
struct rcar_thermal_priv *priv;
struct device *dev = &pdev->dev;
struct resource *res, *irq;
- const struct of_device_id *of_id = of_match_device(rcar_thermal_dt_ids, dev);
- unsigned long of_data = (unsigned long)of_id->data;
+ unsigned long of_data = (unsigned long)of_device_get_match_data(dev);
int mres = 0;
int i;
int ret = -ENODEV;
--
2.7.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: rcar_thermal: don't open code of_device_get_match_data()
2016-03-01 16:38 [PATCH] thermal: rcar_thermal: don't open code of_device_get_match_data() Wolfram Sang
@ 2016-03-02 9:07 ` Geert Uytterhoeven
0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2016-03-02 9:07 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Zhang Rui, Eduardo Valentin, Linux PM list
On Tue, Mar 1, 2016 at 5:38 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> This change will also make Coverity happy by avoiding a theoretical NULL
> pointer dereference; yet another reason is to use the above helper function
> to tighten the code and make it more readable.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-02 9:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 16:38 [PATCH] thermal: rcar_thermal: don't open code of_device_get_match_data() Wolfram Sang
2016-03-02 9:07 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).