Skip to content

Commit 3fab91e

Browse files
AxelLinlinusw
authored andcommitted
gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free
The implementation of lp3943_gpio_request/lp3943_gpio_free test pin_used for tracing the pin usage. However, gpiolib already checks FLAG_REQUESTED flag for the same purpose. So remove the redundant implementation. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent fa283db commit 3fab91e

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

drivers/gpio/gpio-lp3943.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,6 @@ struct lp3943_gpio {
4545
u16 input_mask; /* 1 = GPIO is input direction, 0 = output */
4646
};
4747

48-
static int lp3943_gpio_request(struct gpio_chip *chip, unsigned offset)
49-
{
50-
struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
51-
struct lp3943 *lp3943 = lp3943_gpio->lp3943;
52-
53-
/* Return an error if the pin is already assigned */
54-
if (test_and_set_bit(offset, &lp3943->pin_used))
55-
return -EBUSY;
56-
57-
return 0;
58-
}
59-
60-
static void lp3943_gpio_free(struct gpio_chip *chip, unsigned offset)
61-
{
62-
struct lp3943_gpio *lp3943_gpio = gpiochip_get_data(chip);
63-
struct lp3943 *lp3943 = lp3943_gpio->lp3943;
64-
65-
clear_bit(offset, &lp3943->pin_used);
66-
}
67-
6848
static int lp3943_gpio_set_mode(struct lp3943_gpio *lp3943_gpio, u8 offset,
6949
u8 val)
7050
{
@@ -177,8 +157,6 @@ static int lp3943_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
177157
static const struct gpio_chip lp3943_gpio_chip = {
178158
.label = "lp3943",
179159
.owner = THIS_MODULE,
180-
.request = lp3943_gpio_request,
181-
.free = lp3943_gpio_free,
182160
.direction_input = lp3943_gpio_direction_input,
183161
.get = lp3943_gpio_get,
184162
.direction_output = lp3943_gpio_direction_output,

include/linux/mfd/lp3943.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,12 @@ struct lp3943_reg_cfg {
9494
* @regmap: Used for I2C communication on accessing registers
9595
* @pdata: LP3943 platform specific data
9696
* @mux_cfg: Register configuration for pin MUX
97-
* @pin_used: Bit mask for output pin used.
98-
* This bitmask is used for pin assignment management.
99-
* 1 = pin used, 0 = available.
100-
* Only LSB 16 bits are used, but it is unsigned long type
101-
* for atomic bitwise operations.
10297
*/
10398
struct lp3943 {
10499
struct device *dev;
105100
struct regmap *regmap;
106101
struct lp3943_platform_data *pdata;
107102
const struct lp3943_reg_cfg *mux_cfg;
108-
unsigned long pin_used;
109103
};
110104

111105
int lp3943_read_byte(struct lp3943 *lp3943, u8 reg, u8 *read);

0 commit comments

Comments
 (0)