Received: by 10.223.185.116 with SMTP id b49csp3580637wrg; Mon, 26 Feb 2018 02:28:02 -0800 (PST) X-Google-Smtp-Source: AH8x2247NzBlFhizud42ebo73JPUcoAUiR18aUFNj5uvs0/95Y0qZNHitwABjbCG5sJOoQ5AE758 X-Received: by 10.98.30.67 with SMTP id e64mr10200293pfe.111.1519640882626; Mon, 26 Feb 2018 02:28:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519640882; cv=none; d=google.com; s=arc-20160816; b=qkgKISejT0Ae1UEQDA/9QukismY5xWwnBjqUMR75xJWIplyBYp8bvnQk30yKtCTDDE cSytViIr3bOfTxmYxkU0sObKTAhjsY3FyZ+h88o5MZJxr5HgAT2FiA4Fjotn3TyzvJaz H39wfqmtGv0/DnZ7QFrwiQTSmiwxzkdjA9eveZ/qy1VvCoZuSmoQjS9aOcbmIeWBnxuT rLY/aBncDIieYQSHf92HH1u8uu029AdAA0n47wZtFiXuwomCaxlEvPt1psNX7rV9qAEI NOjCWyvDUl/aa3Yv+6SL68ulcq0ZCjacGes/bahoQmPHiYb/gor+E/Gm7inK88ltTNCf LP2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=I01t6zIORqF+rOcoF8AbgfH/MB0lT3M5F487HC2AwN4=; b=KDK3E92CJN6n9Pf0vYucfQJJQjA17Lo6NVBW/qB4yoKEPslUv2euwkaMYQHrRbeMCI eiMLWQR8i03hcWHbgtfNu7E/ztBChmHrpf6ujAJEp2fvj9zod5zdzjHoHC6jrpqdK8GA lkbKPnyE3/k5qYWGaghKl7z39fMnG9GfSuY5pW9PJJ6u5OFLrOedmdtrGmwtX3pBjI4A QJG9yfE8glq5VAmghOd7tB0cv723V0I3hoMl6kawTyEZzD50iXQT46sV78Afv7mW4WsK KDMWDnZAHWmraITM+yUTUFtHPmyQRiMjTUU0xqkpbJCmi6ULCxEJNJArLnr4awdywU2c 9kng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68-v6si6517423pla.767.2018.02.26.02.27.48; Mon, 26 Feb 2018 02:28:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbeBZK03 (ORCPT + 99 others); Mon, 26 Feb 2018 05:26:29 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48336 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752615AbeBZK0T (ORCPT ); Mon, 26 Feb 2018 05:26:19 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id D731A277267 From: Enric Balletbo i Serra To: lee.jones@linaro.org Cc: groeck@chromium.org, andy.shevchenko@gmail.com, kernel@collabora.com, gwendal@chromium.org, linux-kernel@vger.kernel.org, Daniel Hung-yu Wu , Daniel Hung-yu Wu Subject: [PATCH v3 6/8] mfd: cros_ec_dev: register shutdown function for debugfs Date: Mon, 26 Feb 2018 11:26:04 +0100 Message-Id: <20180226102606.15093-7-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180226102606.15093-1-enric.balletbo@collabora.com> References: <20180226102606.15093-1-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Hung-yu Wu Reboot or shutdown during delayed works could corrupt communication with EC and certain I2C controller may not be able to recover from the error state. This patch registers a shutdown callback used to cancel the debugfs log worker thread. Signed-off-by: Daniel Hung-yu Wu Signed-off-by: Enric Balletbo i Serra Reviewed-by: Andy Shevchenko --- Changes in v3: - [6/8] Add the Reviewed-by Andy Shevchenko. Changes in v2: - [6/8] This patch is new in this series. drivers/mfd/cros_ec_dev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index fd7f0068fb45..354eb9e01d52 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -535,6 +535,14 @@ static int ec_device_remove(struct platform_device *pdev) return 0; } +static void ec_device_shutdown(struct platform_device *pdev) +{ + struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev); + + /* Be sure to clear up debugfs delayed works */ + cros_ec_debugfs_remove(ec); +} + static const struct platform_device_id cros_ec_id[] = { { DRV_NAME, 0 }, { /* sentinel */ }, @@ -577,6 +585,7 @@ static struct platform_driver cros_ec_dev_driver = { }, .probe = ec_device_probe, .remove = ec_device_remove, + .shutdown = ec_device_shutdown, }; static int __init cros_ec_dev_init(void) -- 2.16.1