Re: [PATCH 2/2] SPI: ralink: add Ralink SoC spi driver
From: James Hogan <hidden>
Date: 2013-08-12 16:12:57
Sorry, should have read Mark's feedback first :) James On 12/08/13 17:10, James Hogan wrote:
On 09/08/13 19:51, John Crispin wrote:quoted
+#ifdef DEBUG +#define spi_debug(args...) printk(args) +#else +#define spi_debug(args...) +#endifThis looks a bit like pr_debug. If you have a device pointer around, there's also a dev_dbg which takes an additional device pointer and prepends it's name to the message.quoted
+static int rt2880_spi_probe(struct platform_device *pdev) +{<snip>quoted
+ clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(clk)) { + dev_err(&pdev->dev, "unable to get SYS clock, err=%d\n", + status); + return PTR_ERR(clk); + }<snip>quoted
+} + +static int rt2880_spi_remove(struct platform_device *pdev) +{ + struct spi_master *master; + struct rt2880_spi *rs; + + master = dev_get_drvdata(&pdev->dev); + rs = spi_master_get_devdata(master); + + clk_disable(rs->clk); + clk_put(rs->clk);The devm_clk_get in your probe function means you don't need clk_put here. Cheers James