Fix for incorrect handling of NULL clk pointer in

DaVinci clock code. And a fix to use a more appropiate
 format specifier in a debug message.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJWFRW9AAoJEGFBu2jqvgRNg0QP/3AOJmmU9Yx3P5LqMjN4rkPY
 3H38bH5NbkVdn9FJfXxrvanTJd3ZNfKSIBb2zA5jHcfmT4eGxDgPjl+XRW+O15jA
 p1qlgfzPh/nefTS2Z/nE2U7u/z53f5tMZR1cXoP5uyG5J0IQ5gTxoT8DBqOGR7m4
 u4ExV3tabSvusum3PsqMXZSc5YzbwylwhA2bxI/CC8GRbuxxHLxjzNUunPg/I3Hp
 aSsngWTleccOWzIFWmiPm4tC6svumC3b6/Fh6IYwFDSdsSgUK5A6fcFZRouypMco
 uAiBux86aVlJ7/pSCVhj+VrU9r3m6GusOOz3UVJNvMQKgDlAzpDilQ41h1BCVusH
 b6+gviABd7s5eDMPGgWJOKheSPu/oD++VVMULWgUwnBgt7CHVl0sM0W1K71vuVnO
 ISbRJ7zLXqS15GzjwJ98MvLflb1yzeI6VelFUcNW1yDyopvX2HNK4NnT5kqpqngq
 MXiJq++YNpcKsfmfB/GDop2JFzEsjD0W2z+YEvHfWxHNI+TmNwPRT+8+T+zW+dzN
 lWdb7aopwhrnuN5r7oazrCfdtqwG0cbCEIx5vjYXSm43O2mVQcKzMx5gdgYJYXaA
 LFEWWa0n6xZZfYLDkJBwQ+bXGjhN6llZmBfvbSL0nC2vCu0FdviY6VtmCyMUSKMa
 XllR3Uuq5KhJoNxj7xUq
 =Pbm7
 -----END PGP SIGNATURE-----

Merge tag 'davinci-for-v4.4/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/fixes-non-critical

Merge "DaVinci non-critical fixes for v4.4" from Sekhar Nori:

Fix for incorrect handling of NULL clk pointer in
DaVinci clock code. And a fix to use a more appropiate
format specifier in a debug message.

* tag 'davinci-for-v4.4/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: clock: Correct return values for API functions
  ARM: davinci: re-use %*ph specifier
This commit is contained in:
Arnd Bergmann 2015-10-08 17:24:08 +02:00
commit d24a927025
2 changed files with 12 additions and 8 deletions

View File

@ -546,9 +546,7 @@ static int dm6444evm_msp430_get_pins(void)
if (status < 0)
return status;
dev_dbg(&dm6446evm_msp->dev,
"PINS: %02x %02x %02x %02x\n",
buf[0], buf[1], buf[2], buf[3]);
dev_dbg(&dm6446evm_msp->dev, "PINS: %4ph\n", buf);
return (buf[3] << 8) | buf[2];
}

View File

@ -97,7 +97,9 @@ int clk_enable(struct clk *clk)
{
unsigned long flags;
if (clk == NULL || IS_ERR(clk))
if (!clk)
return 0;
else if (IS_ERR(clk))
return -EINVAL;
spin_lock_irqsave(&clockfw_lock, flags);
@ -124,7 +126,7 @@ EXPORT_SYMBOL(clk_disable);
unsigned long clk_get_rate(struct clk *clk)
{
if (clk == NULL || IS_ERR(clk))
return -EINVAL;
return 0;
return clk->rate;
}
@ -159,8 +161,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
unsigned long flags;
int ret = -EINVAL;
if (clk == NULL || IS_ERR(clk))
return ret;
if (!clk)
return 0;
else if (IS_ERR(clk))
return -EINVAL;
if (clk->set_rate)
ret = clk->set_rate(clk, rate);
@ -181,7 +185,9 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
{
unsigned long flags;
if (clk == NULL || IS_ERR(clk))
if (!clk)
return 0;
else if (IS_ERR(clk))
return -EINVAL;
/* Cannot change parent on enabled clock */