Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5945882ybi; Wed, 31 Jul 2019 05:56:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOgW5fNPqbekvs8e6zjN1CxltAH6YWfZDQQ97Rxj34tVwiq8jDoRo3N519fxjYd850u5pZ X-Received: by 2002:a63:3147:: with SMTP id x68mr50799095pgx.212.1564577778036; Wed, 31 Jul 2019 05:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564577778; cv=none; d=google.com; s=arc-20160816; b=dsJyi8UjWf5yfm1x7zzoXBhGHTBPM/+cLkYfZhN0RERIAzSxprMsMCAFdVMZOX8CT0 bmbq1o/MO0RAgiGj6nTCjzIONQu8uaJ/NM84gxkSHXbtQlq4m9Ab4l0mUP3h68GmMWZm Ibjm8bhgSov4B9WDwdeXoTBbxgeEAtFaXsdrfYiNlvT9YHvQhkLetGJg/9H/RkAE3NdE vBBaRYmjVypfX8fRkZv14UaJSZRH957EcmupaqTv5ZfWWvOQItvkXSYnggIs/BI77ABX JGEqwlh2PBgW5Pc5harJJl8+ghvRKtIgUzN/DWG4DIhFJ9LoKLr3qMKeH04xbD4wfGLH Orog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ve5Yy9yQkLePc0zZaXUf1HQqHg1WNC0vpg/hfHJ5oic=; b=bYdV1YO11/XCrjWleQVrBKz02XqWodk2DPurpvSOjG6Z/IeuyWp7iKp36F2VjpDOEO wNxvejelBvhGxZkdu5UndHaagorvDaKyVufZL+O/OJbj0RwdDX+uxjorRj4zZ1quvZ5O Y0bpV24vfaaRgcnlbvNi9fbC1tdeptu8Z5Vhfv+rLSy/rqVi45/4+xOrApOwOmgTvBKN 4R3CXuCVEOweckbo9EUuiKnUcBLdP++PBA8HNKpJfKY7RCtXF1kc7hfEXDgaaKt+OpLQ OMMXYwudiceNmI8JC1A2IPLEY3gCa0Vrk9mctxn4lERfl+sUl9CMStHkBEhdCtEWYXQb hlzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="T/WtVdWG"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n187si35624252pga.165.2019.07.31.05.56.02; Wed, 31 Jul 2019 05:56:18 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="T/WtVdWG"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388009AbfGaMoW (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:36702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388031AbfGaMoT (ORCPT ); Wed, 31 Jul 2019 08:44:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFB91208E4; Wed, 31 Jul 2019 12:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577058; bh=nNiZ8ynXsKlPw8+PYgzgNs1LsM+1eB+GftUFsgDMy6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/WtVdWGA34wtP6sZsoQK1zpZAAmOBxt2seI7YTbgXcQG1M2VAMPJs5wN4VT5lbHr J4tVeM3kFsvX3fSyJZFaLGlDpJiuW5o6f3O3BVtE+XzfCYsgJZYz9H5/zcsdCZmV23 7ijyYCBHHAoeV3LbNcf7OKAutS/u9+LcGnta5er0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman , Darren Hart , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, platform-driver-x86@vger.kernel.org, Andy Shevchenko Subject: [PATCH v2 06/10] olpc: x01: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:45 +0200 Message-Id: <20190731124349.4474-7-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190731124349.4474-1-gregkh@linuxfoundation.org> References: <20190731124349.4474-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" a lid sysfs file. Cc: Darren Hart Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: platform-driver-x86@vger.kernel.org Acked-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- arch/x86/platform/olpc/olpc-xo1-sci.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc/olpc-xo1-sci.c index 25ce1b3b0732..99a28ce2244c 100644 --- a/arch/x86/platform/olpc/olpc-xo1-sci.c +++ b/arch/x86/platform/olpc/olpc-xo1-sci.c @@ -157,6 +157,12 @@ static ssize_t lid_wake_mode_set(struct device *dev, static DEVICE_ATTR(lid_wake_mode, S_IWUSR | S_IRUGO, lid_wake_mode_show, lid_wake_mode_set); +static struct attribute *lid_attrs[] = { + &dev_attr_lid_wake_mode.attr, + NULL, +}; +ATTRIBUTE_GROUPS(lid); + /* * Process all items in the EC's SCI queue. * @@ -510,17 +516,8 @@ static int setup_lid_switch(struct platform_device *pdev) goto err_register; } - r = device_create_file(&lid_switch_idev->dev, &dev_attr_lid_wake_mode); - if (r) { - dev_err(&pdev->dev, "failed to create wake mode attr: %d\n", r); - goto err_create_attr; - } - return 0; -err_create_attr: - input_unregister_device(lid_switch_idev); - lid_switch_idev = NULL; err_register: input_free_device(lid_switch_idev); return r; @@ -528,7 +525,6 @@ static int setup_lid_switch(struct platform_device *pdev) static void free_lid_switch(void) { - device_remove_file(&lid_switch_idev->dev, &dev_attr_lid_wake_mode); input_unregister_device(lid_switch_idev); } @@ -624,6 +620,7 @@ static int xo1_sci_remove(struct platform_device *pdev) static struct platform_driver xo1_sci_driver = { .driver = { .name = "olpc-xo1-sci-acpi", + .dev_groups = lid_groups, }, .probe = xo1_sci_probe, .remove = xo1_sci_remove, -- 2.22.0