hwmon/occ: Silence probe error message when host is shutdown
PATCH 1/1 hwmon/occ: Silence probe error message when host is shutdown
Signed-off-by Benjamin Herrenschmidt <[email protected]>
--- drivers/hwmon/occ/p9_sbe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/occ/p9_sbe.c +7 -1
@@ -110,6 +110,7 @@ static int p9_sbe_occ_send_cmd(struct occ *occ, u8 *cmd)static int p9_sbe_occ_probe (struct platform_device *pdev) {struct occ *occ; +int rc;struct p9_sbe_occ *ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );
@@ -126,7 +127,12 @@ static int p9_sbe_occ_probe(struct platform_device *pdev) occ->poll_cmd_data =0x20 ;/* P9 OCC poll data */ occ->send_cmd = p9_sbe_occ_send_cmd; -return occ_setup (occ,"p9_occ" ); + rc =occ_setup (occ,"p9_occ" ); + +/* Host is shutdown, don't spew errors */ +if (rc == -ESHUTDOWN ) + rc = -ENODEV ; +return rc; }static int p9_sbe_occ_remove (struct platform_device *pdev)
Signature · 1 line
2.17.0
Quoted 1 line · Benjamin Herrenschmidt
Signed-off-by Benjamin Herrenschmidt <[email protected]>
Reviewed-by Andrew Jeffery <[email protected]>
Quoted 33 lines
--- drivers/hwmon/occ/p9_sbe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/hwmon/occ/p9_sbe.c +7
-1@@ -110,6 +110,7 @@ static int p9_sbe_occ_send_cmd(struct occ *occ, u8 *cmd)static int p9_sbe_occ_probe (struct platform_device *pdev) {struct occ *occ; +int rc;struct p9_sbe_occ *ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );@@ -126,7 +127,12 @@ static int p9_sbe_occ_probe(struct platform_device *pdev) occ->poll_cmd_data =0x20 ;/* P9 OCC poll data */ occ->send_cmd = p9_sbe_occ_send_cmd; -return occ_setup (occ,"p9_occ" ); + rc =occ_setup (occ,"p9_occ" ); + +/* Host is shutdown, don't spew errors */ +if (rc == -ESHUTDOWN ) + rc = -ENODEV ; +return rc; }static int p9_sbe_occ_remove (struct platform_device *pdev)Signature · 1 line
2.17.0