[PATCH] spi: omap2-mcspi: allow NULL from devm_clk_get_optional_enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In addition to an error pointer, devm_clk_get_optional_enabled can also
return NULL, which in omap2-mcspi is not to be considered an error.
Rework  4c6ac5446d06 ("spi: omap2-mcspi: Fix the IS_ERR() bug for
devm_clk_get_optional_enabled()") so the NULL is handled correctly.

Fixes: 4c6ac5446d06 ("spi: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled()")
Signed-off-By: Sicelo A. Mhlongo <absicsz@xxxxxxxxx>
---
 drivers/spi/spi-omap2-mcspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index add6247d3481..cde4416f3cb2 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1561,7 +1561,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	}
 
 	mcspi->ref_clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
-	if (IS_ERR(mcspi->ref_clk))
+	if (IS_ERR_OR_NULL(mcspi->ref_clk))
 		mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ;
 	else
 		mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk);
-- 
2.47.1


--LgJ3JBQbceYg8kUL--




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux