MIPS: TXx9: iocled: Be sure to clamp return value
[linux-drm-fsl-dcu.git] / arch / mips / txx9 / generic / setup.c
index 9d9962ab7d25ccfea97238f402e5dc2f65e20d98..2fd350f31f4b54c4c505700c966cb941b62e4980 100644 (file)
@@ -689,7 +689,7 @@ static int txx9_iocled_get(struct gpio_chip *chip, unsigned int offset)
 {
        struct txx9_iocled_data *data =
                container_of(chip, struct txx9_iocled_data, chip);
-       return data->cur_val & (1 << offset);
+       return !!(data->cur_val & (1 << offset));
 }
 
 static void txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,