Skip to contentSkip to conversation

clk: wm831x: Initialise wm831x pointer on init

PATCH New Mark Brown 2 participants 2 messages Aug 29, 2013 – Aug 30, 2013

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 clk: wm831x: Initialise wm831x pointer on init

From: Mark Brown <[email protected]>

Otherwise any attempt to interact with the hardware will crash. This is what happens when drivers get written blind.

Cc stable at vger.kernel.org
---
 drivers/clk/clk-wm831x.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/clk-wm831x.c +2 -0
index 1b3f8c9..1d5af3f 100644
@@ -360,6 +360,8 @@ static int wm831x_clk_probe(struct platform_device *pdev)
 	if (!clkdata)
 		return -ENOMEM;
 
+	clkdata->wm831x = wm831x;
+
 	/* XTAL_ENA can only be set via OTP/InstantConfig so just read once */
 	ret = wm831x_reg_read(wm831x, WM831X_CLOCK_CONTROL_2);
 	if (ret < 0) {
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/1 clk: wm831x: Initialise wm831x pointer on init

Quoting Mark Brown (2013-08-29 04:21:01)

Quoted 4 lines

From: Mark Brown <[email protected]>

Otherwise any attempt to interact with the hardware will crash. This is what happens when drivers get written blind.

Taken into clk-next.

Regards,
Mike

Quoted 22 lines
Cc stable at vger.kernel.org
---
 drivers/clk/clk-wm831x.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/clk-wm831x.c +2 -0
index 1b3f8c9..1d5af3f 100644
@@ -360,6 +360,8 @@ static int wm831x_clk_probe(struct platform_device *pdev)
        if (!clkdata)
                return -ENOMEM;
 
+       clkdata->wm831x = wm831x;
+
        /* XTAL_ENA can only be set via OTP/InstantConfig so just read once */
        ret = wm831x_reg_read(wm831x, WM831X_CLOCK_CONTROL_2);
        if (ret < 0) {
Signature · 1 line
1.8.4.rc3