mfd: qcom-i2c-pmic: Skip suspend/resume callbacks when interrupts undefined

In the case where the I2C PMIC controller does not have interrupt defined,
skip the suspend and resume callbacks completely as there is nothing
to be done in them.

Change-Id: I26cdf74730acf2f603cc3f36d2643f7ad5522eea
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com>
This commit is contained in:
Jishnu Prakash 2023-01-18 10:58:32 +05:30
parent b8c5cb0086
commit 5ce214e69b

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define pr_fmt(fmt) "I2C PMIC: %s: " fmt, __func__
@ -606,6 +606,7 @@ static int i2c_pmic_probe(struct i2c_client *client,
devm_regmap_qti_debugfs_register(chip->dev, chip->regmap);
i2c_set_clientdata(client, chip);
chip->summary_irq = -EINVAL;
if (!of_property_read_bool(chip->dev->of_node, "interrupt-controller"))
goto probe_children;
@ -700,6 +701,9 @@ static int i2c_pmic_suspend(struct device *dev)
struct i2c_pmic_periph *periph;
int rc = 0, i;
if (chip->summary_irq < 0)
return 0;
for (i = 0; i < chip->num_periphs; i++) {
periph = &chip->periph[i];
@ -733,6 +737,9 @@ static int i2c_pmic_resume(struct device *dev)
struct i2c_pmic_periph *periph;
int rc = 0, i;
if (chip->summary_irq < 0)
return 0;
for (i = 0; i < chip->num_periphs; i++) {
periph = &chip->periph[i];