crypto: tegra-aes: validate clk_get return values
Varun Wadekar [Tue, 7 Jun 2011 13:57:52 +0000 (18:57 +0530)]
instead of checking for NULL, IS_ERR() should
be used to check the validity of a clock handle

Reviewed-on: http://git-master/r/#change,35619
(cherry picked from commit cfb16f57d0a846dba4cd5d6a87c05dcb8efd188d)

Change-Id: If844a166deabc7e67c9af69e4d05f59757773895
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/36218
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: R9a6137402ee132e6b4c1a38ab5d51a3acb035a28

drivers/crypto/tegra-aes.c

index 8facad9..55b7c0d 100644 (file)
@@ -1130,29 +1130,29 @@ static int tegra_aes_probe(struct platform_device *pdev)
        dd->bsea.res_id = TEGRA_ARB_BSEA;
 
        dd->bsev.pclk = clk_get(dev, "bsev");
-       if (!dd->bsev.pclk) {
-               dev_err(dev, "pclock intialization failed.\n");
+       if (IS_ERR(dd->bsev.pclk)) {
+               dev_err(dev, "v: pclock intialization failed.\n");
                err = -ENODEV;
                goto out;
        }
 
        dd->bsev.iclk = clk_get(dev, "vde");
-       if (!dd->bsev.iclk) {
-               dev_err(dev, "iclock intialization failed.\n");
+       if (IS_ERR(dd->bsev.iclk)) {
+               dev_err(dev, "v: iclock intialization failed.\n");
                err = -ENODEV;
                goto out;
        }
 
        dd->bsea.pclk = clk_get(dev, "bsea");
-       if (!dd->bsea.pclk) {
-               dev_err(dev, "pclock intialization failed.\n");
+       if (IS_ERR(dd->bsea.pclk)) {
+               dev_err(dev, "a: pclock intialization failed.\n");
                err = -ENODEV;
                goto out;
        }
 
        dd->bsea.iclk = clk_get(dev, "sclk");
-       if (!dd->bsea.iclk) {
-               dev_err(dev, "iclock intialization failed.\n");
+       if (IS_ERR(dd->bsea.iclk)) {
+               dev_err(dev, "a: iclock intialization failed.\n");
                err = -ENODEV;
                goto out;
        }