Skip to content

Commit 856c651

Browse files
andredlag-linaro
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent adf91d9 commit 856c651

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/mfd/sec-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
164164
int ret, num_sec_devs;
165165

166166
sec_pmic = devm_kzalloc(dev, sizeof(struct sec_pmic_dev), GFP_KERNEL);
167-
if (sec_pmic == NULL)
167+
if (!sec_pmic)
168168
return -ENOMEM;
169169

170170
dev_set_drvdata(dev, sec_pmic);

drivers/mfd/sec-irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ static const struct regmap_irq_chip s5m8767_irq_chip = {
448448

449449
int sec_irq_init(struct sec_pmic_dev *sec_pmic)
450450
{
451-
int ret = 0;
452451
const struct regmap_irq_chip *sec_irq_chip;
452+
int ret;
453453

454454
switch (sec_pmic->device_type) {
455455
case S5M8767X:
@@ -496,7 +496,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
496496
ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic,
497497
sec_pmic->irq, IRQF_ONESHOT,
498498
0, sec_irq_chip, &sec_pmic->irq_data);
499-
if (ret != 0)
499+
if (ret)
500500
return dev_err_probe(sec_pmic->dev, ret,
501501
"Failed to add %s IRQ chip\n",
502502
sec_irq_chip->name);

0 commit comments

Comments
 (0)