[PATCH linux dev-4.13] hwmon/occ: Silence probe error message when host is shutdown

Andrew Jeffery andrew at aj.id.au
Mon May 21 15:45:41 AEST 2018


On Fri, 18 May 2018, at 11:13, Benjamin Herrenschmidt wrote:
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>

Reviewed-by: Andrew Jeffery <andrew at aj.id.au>

> ---
>  drivers/hwmon/occ/p9_sbe.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/occ/p9_sbe.c b/drivers/hwmon/occ/p9_sbe.c
> index 27886897a3d6..9a1d3ae56d69 100644
> --- a/drivers/hwmon/occ/p9_sbe.c
> +++ b/drivers/hwmon/occ/p9_sbe.c
> @@ -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)
> -- 
> 2.17.0
> 


More information about the openbmc mailing list