Skip to content

Commit

Permalink
reset: Change shared flag from int to bool
Browse files Browse the repository at this point in the history
Since the new parameter being added is going to be a bool this patch
changes the shared flag from int to bool to match the new parameter.

Signed-off-by: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Ramiro Oliveira authored and Philipp Zabel committed Jan 20, 2017
1 parent 88a7f52 commit ee48c72
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions drivers/reset/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct reset_control {
struct list_head list;
unsigned int id;
unsigned int refcnt;
int shared;
bool shared;
atomic_t deassert_count;
atomic_t triggered_count;
};
Expand Down Expand Up @@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(reset_control_status);

static struct reset_control *__reset_control_get(
struct reset_controller_dev *rcdev,
unsigned int index, int shared)
unsigned int index, bool shared)
{
struct reset_control *rstc;

Expand Down Expand Up @@ -299,7 +299,7 @@ static void __reset_control_put(struct reset_control *rstc)
}

struct reset_control *__of_reset_control_get(struct device_node *node,
const char *id, int index, int shared)
const char *id, int index, bool shared)
{
struct reset_control *rstc;
struct reset_controller_dev *r, *rcdev;
Expand Down Expand Up @@ -379,7 +379,7 @@ static void devm_reset_control_release(struct device *dev, void *res)
}

struct reset_control *__devm_reset_control_get(struct device *dev,
const char *id, int index, int shared)
const char *id, int index, bool shared)
{
struct reset_control **ptr, *rstc;

Expand Down
32 changes: 16 additions & 16 deletions include/linux/reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ int reset_control_deassert(struct reset_control *rstc);
int reset_control_status(struct reset_control *rstc);

struct reset_control *__of_reset_control_get(struct device_node *node,
const char *id, int index, int shared);
const char *id, int index, bool shared);
void reset_control_put(struct reset_control *rstc);
struct reset_control *__devm_reset_control_get(struct device *dev,
const char *id, int index, int shared);
const char *id, int index, bool shared);

int __must_check device_reset(struct device *dev);

Expand Down Expand Up @@ -69,14 +69,14 @@ static inline int device_reset_optional(struct device *dev)

static inline struct reset_control *__of_reset_control_get(
struct device_node *node,
const char *id, int index, int shared)
const char *id, int index, bool shared)
{
return ERR_PTR(-ENOTSUPP);
}

static inline struct reset_control *__devm_reset_control_get(
struct device *dev,
const char *id, int index, int shared)
const char *id, int index, bool shared)
{
return ERR_PTR(-ENOTSUPP);
}
Expand Down Expand Up @@ -132,19 +132,19 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id)
static inline struct reset_control *reset_control_get_shared(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true);
}

static inline struct reset_control *reset_control_get_optional_exclusive(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false);
}

static inline struct reset_control *reset_control_get_optional_shared(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true);
}

/**
Expand Down Expand Up @@ -185,7 +185,7 @@ static inline struct reset_control *of_reset_control_get_exclusive(
static inline struct reset_control *of_reset_control_get_shared(
struct device_node *node, const char *id)
{
return __of_reset_control_get(node, id, 0, 1);
return __of_reset_control_get(node, id, 0, true);
}

/**
Expand All @@ -202,7 +202,7 @@ static inline struct reset_control *of_reset_control_get_shared(
static inline struct reset_control *of_reset_control_get_exclusive_by_index(
struct device_node *node, int index)
{
return __of_reset_control_get(node, NULL, index, 0);
return __of_reset_control_get(node, NULL, index, false);
}

/**
Expand Down Expand Up @@ -230,7 +230,7 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
static inline struct reset_control *of_reset_control_get_shared_by_index(
struct device_node *node, int index)
{
return __of_reset_control_get(node, NULL, index, 1);
return __of_reset_control_get(node, NULL, index, true);
}

/**
Expand All @@ -252,7 +252,7 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
#ifndef CONFIG_RESET_CONTROLLER
WARN_ON(1);
#endif
return __devm_reset_control_get(dev, id, 0, 0);
return __devm_reset_control_get(dev, id, 0, false);
}

/**
Expand All @@ -267,19 +267,19 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
static inline struct reset_control *devm_reset_control_get_shared(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 1);
return __devm_reset_control_get(dev, id, 0, true);
}

static inline struct reset_control *devm_reset_control_get_optional_exclusive(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 0);
return __devm_reset_control_get(dev, id, 0, false);
}

static inline struct reset_control *devm_reset_control_get_optional_shared(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 1);
return __devm_reset_control_get(dev, id, 0, true);
}

/**
Expand All @@ -297,7 +297,7 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
static inline struct reset_control *
devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
{
return __devm_reset_control_get(dev, NULL, index, 0);
return __devm_reset_control_get(dev, NULL, index, false);
}

/**
Expand All @@ -313,7 +313,7 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
static inline struct reset_control *
devm_reset_control_get_shared_by_index(struct device *dev, int index)
{
return __devm_reset_control_get(dev, NULL, index, 1);
return __devm_reset_control_get(dev, NULL, index, true);
}

/*
Expand Down

0 comments on commit ee48c72

Please sign in to comment.