crypto: tegra-aes: replace dev_err and add NULL checking
Jubeom Kim [Wed, 22 Jun 2011 12:46:42 +0000 (21:46 +0900)]
Changed dev_err to pr_err because 'dd' can be NULL.
Added NULL checking before clock disable of engine->pclk

Reviewed-on: http://git-master/r/37857
(cherry picked from commit 851ffd0a30cbe67a5033a9792825b319f0bcd7ed)

Original-Change-Id: If5a2bbd550f3dc038b42d8a185647d02df9cb593
Reviewed-on: http://git-master/r/38446
Tested-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: R57fa4ce4a2e95d80813448ad5234fb9bdf74faf1

drivers/crypto/tegra-aes.c

index 55b7c0d..dab01ef 100644 (file)
@@ -307,7 +307,8 @@ static int aes_hw_init(struct tegra_aes_engine *engine)
                if (ret < 0) {
                        dev_err(dd->dev, "%s: iclock enable fail(%d)\n",
                        __func__, ret);
-                       clk_disable(engine->pclk);
+                       if (engine->pclk)
+                               clk_disable(engine->pclk);
                        return ret;
                }
        }
@@ -661,7 +662,7 @@ static int tegra_aes_setkey(struct crypto_ablkcipher *tfm, const u8 *key,
        struct tegra_aes_slot *key_slot;
 
        if (!ctx || !dd) {
-               dev_err(dd->dev, "ctx=0x%x, dd=0x%x\n",
+               pr_err("ctx=0x%x, dd=0x%x\n",
                        (unsigned int)ctx, (unsigned int)dd);
                return -EINVAL;
        }