[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240215220759.976998-17-eajames@linux.ibm.com>
Date: Thu, 15 Feb 2024 16:07:42 -0600
From: Eddie James <eajames@...ux.ibm.com>
To: linux-fsi@...ts.ozlabs.org
Cc: linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
andi.shyti@...nel.org, eajames@...ux.ibm.com, alistair@...ple.id.au,
joel@....id.au, jk@...abs.org, sboyd@...nel.org,
mturquette@...libre.com, robh@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org
Subject: [PATCH 16/33] fsi: aspeed: Remove cfam reset sysfs file in error path and remove
This fixes a duplicate sysfs warning on device re-probe.
Signed-off-by: Eddie James <eajames@...ux.ibm.com>
---
drivers/fsi/fsi-master-aspeed.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index 2258980e4c47..c36e7e49e965 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -410,6 +410,7 @@ static int setup_cfam_reset(struct fsi_master_aspeed *aspeed)
rc = device_create_file(dev, &dev_attr_cfam_reset);
if (rc) {
+ aspeed->cfam_reset_gpio = NULL;
devm_gpiod_put(dev, gpio);
return rc;
}
@@ -575,6 +576,9 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev)
err_regmap:
regmap_exit(aspeed->master.map);
err_release:
+ if (aspeed->cfam_reset_gpio)
+ device_remove_file(aspeed->dev, &dev_attr_cfam_reset);
+
clk_disable_unprepare(aspeed->clk);
err_free_aspeed:
kfree(aspeed);
@@ -585,6 +589,9 @@ static int fsi_master_aspeed_remove(struct platform_device *pdev)
{
struct fsi_master_aspeed *aspeed = platform_get_drvdata(pdev);
+ if (aspeed->cfam_reset_gpio)
+ device_remove_file(aspeed->dev, &dev_attr_cfam_reset);
+
fsi_master_unregister(&aspeed->master);
clk_disable_unprepare(aspeed->clk);
--
2.39.3
Powered by blists - more mailing lists