From patchwork Wed Jan 24 21:26:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 10183123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DB3E60233 for ; Wed, 24 Jan 2018 21:26:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 401362897C for ; Wed, 24 Jan 2018 21:26:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34E6B2897F; Wed, 24 Jan 2018 21:26:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A802897C for ; Wed, 24 Jan 2018 21:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932776AbeAXV0M (ORCPT ); Wed, 24 Jan 2018 16:26:12 -0500 Received: from avasout06.plus.net ([212.159.14.18]:52252 "EHLO avasout06.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbeAXV0M (ORCPT ); Wed, 24 Jan 2018 16:26:12 -0500 Received: from lava ([80.229.148.18]) by smtp with ESMTP id eSYceV5PudzR4eSYdeMieS; Wed, 24 Jan 2018 21:26:11 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=CaYmGojl c=1 sm=1 tr=0 a=o7Djd4SkmPXITDn8qH+ssQ==:117 a=o7Djd4SkmPXITDn8qH+ssQ==:17 a=RgaUWeydRksA:10 a=beXlt2xKAAAA:8 a=pozsvbH4ZBpeKkKAXkgA:9 a=gcY2M4Ci8LIz02MwfSIM:22 Received: from nick by lava with local (Exim 4.86_2) (envelope-from ) id 1eeSYb-0007Am-5t; Wed, 24 Jan 2018 21:26:09 +0000 From: Nick Dyer To: Dmitry Torokhov Cc: Benjamin Tissoires , Andrew Duggan , Christopher Heiny , linux-input@vger.kernel.org, Chris Healy , Lucas Stach , Nick Dyer Subject: [PATCH v1] Revert "Input: synaptics_rmi4 - use devm_device_add_group() for attributes in F01" Date: Wed, 24 Jan 2018 21:26:03 +0000 Message-Id: <1516829163-27534-1-git-send-email-nick@shmanahar.org> X-Mailer: git-send-email 2.7.4 X-CMAE-Envelope: MS4wfNJbfckzjs76xcVHykCM1uW8OSSWF8XC8tuJk3Il9TX0qvBs8ggpnRfXGmY1KVLufH2BzdSW6UOgLRC1hZlLyDGKfw87HSI24Xqm1qk7EKsgpsHCzcSe II61loC+J4dZRj3n/JaAVW0MWBWuqiJQJKs= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the sysfs attribute hangs off the RMI bus, which doesn't go away during firmware flash, it needs to be explictly removed, otherwise we would try and register the same attribute twice. This reverts commit 36a44af5c176d619552d99697433261141dd1296. Signed-off-by: Nick Dyer --- drivers/input/rmi4/rmi_f01.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c index ae966e3..8a07ae1 100644 --- a/drivers/input/rmi4/rmi_f01.c +++ b/drivers/input/rmi4/rmi_f01.c @@ -570,14 +570,19 @@ static int rmi_f01_probe(struct rmi_function *fn) dev_set_drvdata(&fn->dev, f01); - error = devm_device_add_group(&fn->rmi_dev->dev, &rmi_f01_attr_group); + error = sysfs_create_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group); if (error) - dev_warn(&fn->dev, - "Failed to create attribute group: %d\n", error); + dev_warn(&fn->dev, "Failed to create sysfs group: %d\n", error); return 0; } +static void rmi_f01_remove(struct rmi_function *fn) +{ + /* Note that the bus device is used, not the F01 device */ + sysfs_remove_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group); +} + static int rmi_f01_config(struct rmi_function *fn) { struct f01_data *f01 = dev_get_drvdata(&fn->dev); @@ -717,6 +722,7 @@ struct rmi_function_handler rmi_f01_handler = { }, .func = 0x01, .probe = rmi_f01_probe, + .remove = rmi_f01_remove, .config = rmi_f01_config, .attention = rmi_f01_attention, .suspend = rmi_f01_suspend,