diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-10-13 16:31:57 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-10-13 16:31:57 -0700 |
commit | 2b090d9432eb704e3d718a0a05a3d62437b1863f (patch) | |
tree | 35baef756aa643f04a3a6af7aa97ad5d7ec6177a /arch/avr32/mach-at32ap/clock.c | |
parent | 1f18cad529990d6637c6b7f49f79a4c3928ccf05 (diff) | |
parent | ac6d8ef9174fc00b7ea3ff2474fc57f531d312c2 (diff) |
Merge tag 'v3.18.22' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.18
Linux 3.18.22
* tag 'v3.18.22' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (178 commits)
Linux 3.18.22
net: call rcu_read_lock early in process_backlog
lpfc: Fix scsi prep dma buf error.
rds: fix an integer overflow test in rds_info_getsockopt()
net/mlx4_core: Fix wrong index in propagating port change event to VFs
netlink: don't hold mutex in rcu callback when releasing mmapd ring
inet: frags: fix defragmented packet's IP header for af_packet
bonding: correct the MAC address for "follow" fail_over_mac policy
bonding: fix destruction of bond with devices different from arphrd_ether
ipv6: lock socket in ip6_datagram_connect()
isdn/gigaset: reset tty->receive_room when attaching ser_gigaset
bridge: mdb: fix double add notification
net: Fix skb csum races when peeking
net: do not process device backlog during unregistration
net: pktgen: fix race between pktgen_thread_worker() and kthread_stop()
bridge: mdb: zero out the local br_ip variable before use
net/tipc: initialize security state for new connection socket
ip_tunnel: fix ipv4 pmtu check to honor inner ip header df
net: graceful exit from netif_alloc_netdev_queues()
ipv6: Make MLD packets to only be processed locally
...
Diffstat (limited to 'arch/avr32/mach-at32ap/clock.c')
-rw-r--r-- | arch/avr32/mach-at32ap/clock.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c index 23b1a97fae7a..52c179bec0cc 100644 --- a/arch/avr32/mach-at32ap/clock.c +++ b/arch/avr32/mach-at32ap/clock.c @@ -80,6 +80,9 @@ int clk_enable(struct clk *clk) { unsigned long flags; + if (!clk) + return 0; + spin_lock_irqsave(&clk_lock, flags); __clk_enable(clk); spin_unlock_irqrestore(&clk_lock, flags); @@ -106,6 +109,9 @@ void clk_disable(struct clk *clk) { unsigned long flags; + if (IS_ERR_OR_NULL(clk)) + return; + spin_lock_irqsave(&clk_lock, flags); __clk_disable(clk); spin_unlock_irqrestore(&clk_lock, flags); @@ -117,6 +123,9 @@ unsigned long clk_get_rate(struct clk *clk) unsigned long flags; unsigned long rate; + if (!clk) + return 0; + spin_lock_irqsave(&clk_lock, flags); rate = clk->get_rate(clk); spin_unlock_irqrestore(&clk_lock, flags); @@ -129,6 +138,9 @@ long clk_round_rate(struct clk *clk, unsigned long rate) { unsigned long flags, actual_rate; + if (!clk) + return 0; + if (!clk->set_rate) return -ENOSYS; @@ -145,6 +157,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) unsigned long flags; long ret; + if (!clk) + return 0; + if (!clk->set_rate) return -ENOSYS; @@ -161,6 +176,9 @@ int clk_set_parent(struct clk *clk, struct clk *parent) unsigned long flags; int ret; + if (!clk) + return 0; + if (!clk->set_parent) return -ENOSYS; @@ -174,7 +192,7 @@ EXPORT_SYMBOL(clk_set_parent); struct clk *clk_get_parent(struct clk *clk) { - return clk->parent; + return !clk ? NULL : clk->parent; } EXPORT_SYMBOL(clk_get_parent); |