summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@linaro.org>2025-04-09 23:37:40 +0300
committerLee Jones <lee@kernel.org>2025-05-23 10:48:45 +0300
commit856c6514d5ab491a5ad4be6e797d0d5283ad51aa (patch)
treeb9089a073b2e008e22e67ed7eaeaafa94da81e42
parentadf91d9e1983dec3d5fabc273e8ff89918b852c1 (diff)
downloadlinux-856c6514d5ab491a5ad4be6e797d0d5283ad51aa.tar.xz
mfd: sec: Don't compare against NULL / 0 for errors, use !
Follow general style and use if (!arg) instead of comparing against NULL. While at it, drop a useless init in sec-irq.c. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-19-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r--drivers/mfd/sec-common.c2
-rw-r--r--drivers/mfd/sec-irq.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mfd/sec-common.c b/drivers/mfd/sec-common.c
index 4871492548f5..55edeb0f73ff 100644
--- a/drivers/mfd/sec-common.c
+++ b/drivers/mfd/sec-common.c
@@ -164,7 +164,7 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
int ret, num_sec_devs;
sec_pmic = devm_kzalloc(dev, sizeof(struct sec_pmic_dev), GFP_KERNEL);
- if (sec_pmic == NULL)
+ if (!sec_pmic)
return -ENOMEM;
dev_set_drvdata(dev, sec_pmic);
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 54c674574c70..4a6585a6acdb 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -448,8 +448,8 @@ static const struct regmap_irq_chip s5m8767_irq_chip = {
int sec_irq_init(struct sec_pmic_dev *sec_pmic)
{
- int ret = 0;
const struct regmap_irq_chip *sec_irq_chip;
+ int ret;
switch (sec_pmic->device_type) {
case S5M8767X:
@@ -496,7 +496,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic,
sec_pmic->irq, IRQF_ONESHOT,
0, sec_irq_chip, &sec_pmic->irq_data);
- if (ret != 0)
+ if (ret)
return dev_err_probe(sec_pmic->dev, ret,
"Failed to add %s IRQ chip\n",
sec_irq_chip->name);