Commit 8c1b1e54 authored by Stephen Boyd's avatar Stephen Boyd

clk: at91: Remove impossible checks for of_clk_get_parent_count()

These checks for < 0 are impossible now that
of_clk_get_parent_count() returns an unsigned int. Change the
checks for == 0 and update the type.

Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 929e7f3b
...@@ -268,13 +268,13 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np, ...@@ -268,13 +268,13 @@ void __init of_sama5d2_clk_generated_setup(struct device_node *np,
u32 id; u32 id;
const char *name; const char *name;
struct clk *clk; struct clk *clk;
int num_parents; unsigned int num_parents;
const char *parent_names[GENERATED_SOURCE_MAX]; const char *parent_names[GENERATED_SOURCE_MAX];
struct device_node *gcknp; struct device_node *gcknp;
struct clk_range range = CLK_RANGE(0, 0); struct clk_range range = CLK_RANGE(0, 0);
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > GENERATED_SOURCE_MAX) if (num_parents == 0 || num_parents > GENERATED_SOURCE_MAX)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
......
...@@ -611,12 +611,12 @@ void __init of_at91sam9x5_clk_main_setup(struct device_node *np, ...@@ -611,12 +611,12 @@ void __init of_at91sam9x5_clk_main_setup(struct device_node *np,
{ {
struct clk *clk; struct clk *clk;
const char *parent_names[2]; const char *parent_names[2];
int num_parents; unsigned int num_parents;
unsigned int irq; unsigned int irq;
const char *name = np->name; const char *name = np->name;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > 2) if (num_parents == 0 || num_parents > 2)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
......
...@@ -221,14 +221,14 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, ...@@ -221,14 +221,14 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc,
const struct clk_master_layout *layout) const struct clk_master_layout *layout)
{ {
struct clk *clk; struct clk *clk;
int num_parents; unsigned int num_parents;
unsigned int irq; unsigned int irq;
const char *parent_names[MASTER_SOURCE_MAX]; const char *parent_names[MASTER_SOURCE_MAX];
const char *name = np->name; const char *name = np->name;
struct clk_master_characteristics *characteristics; struct clk_master_characteristics *characteristics;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > MASTER_SOURCE_MAX) if (num_parents == 0 || num_parents > MASTER_SOURCE_MAX)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
......
...@@ -232,13 +232,13 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, ...@@ -232,13 +232,13 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc,
int num; int num;
u32 id; u32 id;
struct clk *clk; struct clk *clk;
int num_parents; unsigned int num_parents;
const char *parent_names[PROG_SOURCE_MAX]; const char *parent_names[PROG_SOURCE_MAX];
const char *name; const char *name;
struct device_node *progclknp; struct device_node *progclknp;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > PROG_SOURCE_MAX) if (num_parents == 0 || num_parents > PROG_SOURCE_MAX)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
......
...@@ -366,11 +366,11 @@ void __init of_at91sam9x5_clk_slow_setup(struct device_node *np, ...@@ -366,11 +366,11 @@ void __init of_at91sam9x5_clk_slow_setup(struct device_node *np,
{ {
struct clk *clk; struct clk *clk;
const char *parent_names[2]; const char *parent_names[2];
int num_parents; unsigned int num_parents;
const char *name = np->name; const char *name = np->name;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > 2) if (num_parents == 0 || num_parents > 2)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
...@@ -437,7 +437,7 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np, ...@@ -437,7 +437,7 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
{ {
struct clk *clk; struct clk *clk;
const char *parent_names[2]; const char *parent_names[2];
int num_parents; unsigned int num_parents;
const char *name = np->name; const char *name = np->name;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
......
...@@ -145,12 +145,12 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, ...@@ -145,12 +145,12 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np,
struct at91_pmc *pmc) struct at91_pmc *pmc)
{ {
struct clk *clk; struct clk *clk;
int num_parents; unsigned int num_parents;
const char *parent_names[SMD_SOURCE_MAX]; const char *parent_names[SMD_SOURCE_MAX];
const char *name = np->name; const char *name = np->name;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > SMD_SOURCE_MAX) if (num_parents == 0 || num_parents > SMD_SOURCE_MAX)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
......
...@@ -373,12 +373,12 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, ...@@ -373,12 +373,12 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np,
struct at91_pmc *pmc) struct at91_pmc *pmc)
{ {
struct clk *clk; struct clk *clk;
int num_parents; unsigned int num_parents;
const char *parent_names[USB_SOURCE_MAX]; const char *parent_names[USB_SOURCE_MAX];
const char *name = np->name; const char *name = np->name;
num_parents = of_clk_get_parent_count(np); num_parents = of_clk_get_parent_count(np);
if (num_parents <= 0 || num_parents > USB_SOURCE_MAX) if (num_parents == 0 || num_parents > USB_SOURCE_MAX)
return; return;
of_clk_parent_fill(np, parent_names, num_parents); of_clk_parent_fill(np, parent_names, num_parents);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment