Skip to content

Change return type of of_clk_get_parent_count() to unsigned

Stephen Boyd linux-clk linux-fbdev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9clk: Make of_clk_get_parent_count() return unsigned intsdrivers/clk/clk.c include/linux/clk-provider.h+15 -30 replies
2/9clk: at91: Remove impossible checks for of_clk_get_parent_count()drivers/clk/at91/clk-generated.c drivers/clk/at91/clk-main.c drivers/clk/at91/clk-master.c +4 more+15 -150 replies
3/9clk: gpio: Remove impossible check for of_clk_get_parent_count() < 0drivers/clk/clk-gpio.c+2 -40 replies
4/9clk: h8300: Remove impossible check for of_clk_get_parent_count()drivers/clk/h8300/clk-div.c drivers/clk/h8300/clk-h8s2678.c+4 -40 replies
5/9clk: st: Remove impossible check for of_clk_get_parent_count() < 0drivers/clk/st/clk-flexgen.c drivers/clk/st/clkgen-mux.c+4 -40 replies
6/9clk: sunxi: Use proper type for of_clk_get_parent_count() return valuedrivers/clk/sunxi/clk-sun6i-ar100.c+1 -10 replies
7/9clk: ti: Update for of_clk_get_parent_count() returning unsigned intdrivers/clk/ti/clockdomain.c drivers/clk/ti/composite.c drivers/clk/ti/dpll.c +1 more+8 -80 replies
8/9usb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0drivers/usb/dwc3/dwc3-of-simple.c+5 -41 reply
9/9simplefb: Remove impossible check for of_clk_get_parent_count() < 0drivers/video/fbdev/simplefb.c+2 -21 reply

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by.

PatchFelipe BalbiTomi Valkeinen
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9A-b
9/9A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] Change return type of of_clk_get_parent_count() to unsigned

Russell King recently pointed out that of_clk_get_parent_count() can return a negative number if the "clocks" property isn't present in a node. Upon investigating all the callers of this API, none of the them seem to care about that case, and furthermore some callers are assigning the return value to an unsigned int which could cause very large numbers of parents to be used.

This series changes the API to return an unsigned int from 0 (no parents) to N, thereby avoiding any problems with negative return values.

Cc Boris Brezillon <[email protected]>
Cc Yoshinori Sato <[email protected]>
Cc Gabriel Fernandez <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc Tero Kristo <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>

Stephen Boyd (9):
clk: Make of_clk_get_parent_count() return unsigned ints
clk: at91: Remove impossible checks for of_clk_get_parent_count()
clk: gpio: Remove impossible check for of_clk_get_parent_count() < 0
clk: h8300: Remove impossible check for of_clk_get_parent_count()
clk: st: Remove impossible check for of_clk_get_parent_count() < 0
clk: sunxi: Use proper type for of_clk_get_parent_count() return value
clk: ti: Update for of_clk_get_parent_count() returning unsigned int
usb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0
simplefb: Remove impossible check for of_clk_get_parent_count() < 0

 drivers/clk/at91/clk-generated.c    |  4 ++--
 drivers/clk/at91/clk-main.c         |  4 ++--
 drivers/clk/at91/clk-master.c       |  4 ++--
 drivers/clk/at91/clk-programmable.c |  4 ++--
 drivers/clk/at91/clk-slow.c         |  6 +++---
 drivers/clk/at91/clk-smd.c          |  4 ++--
 drivers/clk/at91/clk-usb.c          |  4 ++--
 drivers/clk/clk-gpio.c              |  6 ++----
 drivers/clk/clk.c                   | 16 ++++++++++++++--
 drivers/clk/h8300/clk-div.c         |  4 ++--
 drivers/clk/h8300/clk-h8s2678.c     |  4 ++--
 drivers/clk/st/clk-flexgen.c        |  4 ++--
 drivers/clk/st/clkgen-mux.c         |  4 ++--
 drivers/clk/sunxi/clk-sun6i-ar100.c |  2 +-
 drivers/clk/ti/clockdomain.c        |  2 +-
 drivers/clk/ti/composite.c          |  8 ++++----
 drivers/clk/ti/dpll.c               |  2 +-
 drivers/clk/ti/mux.c                |  4 ++--
 drivers/usb/dwc3/dwc3-of-simple.c   |  9 +++++----
 drivers/video/fbdev/simplefb.c      |  4 ++--
 include/linux/clk-provider.h        |  2 +-
 21 files changed, 56 insertions(+), 45 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project