From patchwork Wed Jul 31 12:43:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11067767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42C0D14DB for ; Wed, 31 Jul 2019 12:44:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E25227F60 for ; Wed, 31 Jul 2019 12:44:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 215C328671; Wed, 31 Jul 2019 12:44: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B3BFA27F60 for ; Wed, 31 Jul 2019 12:44:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCED389DB0; Wed, 31 Jul 2019 12:44:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B3C389DB0 for ; Wed, 31 Jul 2019 12:44:10 +0000 (UTC) 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 0C0D92089E; Wed, 31 Jul 2019 12:44:09 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Subject: [PATCH v2 03/10] input: keyboard: gpio_keys: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:42 +0200 Message-Id: <20190731124349.4474-4-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 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577050; bh=9QHmlV3UC/Ih0nbNZ6S7QqAFc2A/UoarGKig2YK8eAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sLmDhPMnwFa4bHwcL2y6xpUezufEHiDE7DhS2/7BfgfJWrIEYEYxH31VTQZEIsdIt YT+n/CCuy3wNxsvj2858TbE4QSuC4Sv1tSJpwLGWfyh3dJGiqycRYEnlAVsUUETR2P TcU5hYJ8Zp+lZ71ompEcetmnfk4b3G+DjeC9Iog8= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 bunch of sysfs files. Cc: Bartlomiej Zolnierkiewicz Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/input/keyboard/gpio_keys.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 03f4d152f6b7..1373dc5b0765 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -351,10 +351,7 @@ static struct attribute *gpio_keys_attrs[] = { &dev_attr_disabled_switches.attr, NULL, }; - -static const struct attribute_group gpio_keys_attr_group = { - .attrs = gpio_keys_attrs, -}; +ATTRIBUTE_GROUPS(gpio_keys); static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) { @@ -851,13 +848,6 @@ static int gpio_keys_probe(struct platform_device *pdev) fwnode_handle_put(child); - error = devm_device_add_group(dev, &gpio_keys_attr_group); - if (error) { - dev_err(dev, "Unable to export keys/switches, error: %d\n", - error); - return error; - } - error = input_register_device(input); if (error) { dev_err(dev, "Unable to register input device, error: %d\n", @@ -1026,6 +1016,7 @@ static struct platform_driver gpio_keys_device_driver = { .name = "gpio-keys", .pm = &gpio_keys_pm_ops, .of_match_table = gpio_keys_of_match, + .dev_groups = gpio_keys_groups, } }; From patchwork Wed Jul 31 12:43:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11067777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE55613B1 for ; Wed, 31 Jul 2019 12:44:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D93142892B for ; Wed, 31 Jul 2019 12:44:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD50A288C3; Wed, 31 Jul 2019 12:44:25 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B904828458 for ; Wed, 31 Jul 2019 12:44:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1C858912B; Wed, 31 Jul 2019 12:44:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6512C89113 for ; Wed, 31 Jul 2019 12:44:23 +0000 (UTC) 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 BCEA32171F; Wed, 31 Jul 2019 12:44:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Subject: [PATCH v2 08/10] video: fbdev: wm8505fb: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:47 +0200 Message-Id: <20190731124349.4474-9-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 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577063; bh=Fje3AeopR107kcdoqaZJYzJTIvkoN1dobGnTqwrXqOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CT0cwL2e/r+3RDaMoTK/tZK11LleUq09ZrKXH8NIp2+SsEkEBYsyzlWLf5H5DNx5r /r89HPJxOH8CfFqC/YUAjSDax2bl9UUKeEzY6rxSximoTLNC6+8muabt9MApGxY/2T lv4zTDtA7H5/27ELhezJ1UcxQQhuV0jZjk0zmZ1U= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, Tony Prisk , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 sysfs file. Cc: Tony Prisk Cc: Bartlomiej Zolnierkiewicz Cc: linux-arm-kernel@lists.infradead.org Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/wm8505fb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c index ff752635a31c..17c780315ca5 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c @@ -176,6 +176,12 @@ static ssize_t contrast_store(struct device *dev, static DEVICE_ATTR_RW(contrast); +static struct attribute *wm8505fb_attrs[] = { + &dev_attr_contrast.attr, + NULL, +}; +ATTRIBUTE_GROUPS(wm8505fb); + static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf) { chan &= 0xffff; @@ -361,10 +367,6 @@ static int wm8505fb_probe(struct platform_device *pdev) return ret; } - ret = device_create_file(&pdev->dev, &dev_attr_contrast); - if (ret < 0) - fb_warn(&fbi->fb, "failed to register attributes (%d)\n", ret); - fb_info(&fbi->fb, "%s frame buffer at 0x%lx-0x%lx\n", fbi->fb.fix.id, fbi->fb.fix.smem_start, fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1); @@ -376,8 +378,6 @@ static int wm8505fb_remove(struct platform_device *pdev) { struct wm8505fb_info *fbi = platform_get_drvdata(pdev); - device_remove_file(&pdev->dev, &dev_attr_contrast); - unregister_framebuffer(&fbi->fb); writel(0, fbi->regbase); @@ -399,6 +399,7 @@ static struct platform_driver wm8505fb_driver = { .driver = { .name = DRIVER_NAME, .of_match_table = wmt_dt_ids, + .dev_groups = wm8505fb_groups, }, }; From patchwork Wed Jul 31 12:43:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11067785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B99F113B1 for ; Wed, 31 Jul 2019 12:44:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A50A7205FC for ; Wed, 31 Jul 2019 12:44:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9949E288C4; Wed, 31 Jul 2019 12:44:29 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 43D3E205FC for ; Wed, 31 Jul 2019 12:44:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DD5889A75; Wed, 31 Jul 2019 12:44:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id EABE989728 for ; Wed, 31 Jul 2019 12:44:25 +0000 (UTC) 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 5EAFE217D4; Wed, 31 Jul 2019 12:44:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Subject: [PATCH v2 09/10] video: fbdev: w100fb: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:48 +0200 Message-Id: <20190731124349.4474-10-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 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577065; bh=WkqAHanTxQx5yUJI8jkG4KR2Oxhqk5ywNQpUPn5vZ0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IeGNaHqO7mU7FVNZgLJgpD1nSBX+og+oFJK8Lv70p6INJwOHscvf3U50pBreu3WaC gadW9vLuBIPrHaP36YcZaIAw9E3xLPWA4pPXwBZy5n9fdcSie6vqxP5wzl5RiCJfdu sU7JqBxB+9Ut+zINEm3Qivs89aq6PTpwxdTuHKvU= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, Tony Prisk , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 bunch of sysfs files. Cc: Tony Prisk Cc: linux-arm-kernel@lists.infradead.org Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/w100fb.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c index 597ffaa13cd2..3be07807edcd 100644 --- a/drivers/video/fbdev/w100fb.c +++ b/drivers/video/fbdev/w100fb.c @@ -164,6 +164,15 @@ static ssize_t fastpllclk_store(struct device *dev, struct device_attribute *att static DEVICE_ATTR_RW(fastpllclk); +static struct attribute *w100fb_attrs[] = { + &dev_attr_fastpllclk.attr, + &dev_attr_reg_read.attr, + &dev_attr_reg_write.attr, + &dev_attr_flip.attr, + NULL, +}; +ATTRIBUTE_GROUPS(w100fb); + /* * Some touchscreens need hsync information from the video driver to * function correctly. We export it here. @@ -752,14 +761,6 @@ int w100fb_probe(struct platform_device *pdev) goto out; } - err = device_create_file(&pdev->dev, &dev_attr_fastpllclk); - err |= device_create_file(&pdev->dev, &dev_attr_reg_read); - err |= device_create_file(&pdev->dev, &dev_attr_reg_write); - err |= device_create_file(&pdev->dev, &dev_attr_flip); - - if (err != 0) - fb_warn(info, "failed to register attributes (%d)\n", err); - fb_info(info, "%s frame buffer device\n", info->fix.id); return 0; out: @@ -784,11 +785,6 @@ static int w100fb_remove(struct platform_device *pdev) struct fb_info *info = platform_get_drvdata(pdev); struct w100fb_par *par=info->par; - device_remove_file(&pdev->dev, &dev_attr_fastpllclk); - device_remove_file(&pdev->dev, &dev_attr_reg_read); - device_remove_file(&pdev->dev, &dev_attr_reg_write); - device_remove_file(&pdev->dev, &dev_attr_flip); - unregister_framebuffer(info); vfree(par->saved_intmem); @@ -1625,6 +1621,7 @@ static struct platform_driver w100fb_driver = { .resume = w100fb_resume, .driver = { .name = "w100fb", + .dev_groups = w100fb_groups, }, }; From patchwork Wed Jul 31 12:43:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11067759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A19EC14DB for ; Wed, 31 Jul 2019 12:44:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D0C71FF13 for ; Wed, 31 Jul 2019 12:44:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8135D28671; Wed, 31 Jul 2019 12:44:07 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 12698205FC for ; Wed, 31 Jul 2019 12:44:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2973189CE0; Wed, 31 Jul 2019 12:44:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70DBD89CE0 for ; Wed, 31 Jul 2019 12:44:05 +0000 (UTC) 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 D3CD6208E3; Wed, 31 Jul 2019 12:44:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Subject: [PATCH v2 10/10] video: fbdev: sm501fb: convert platform driver to use dev_groups Date: Wed, 31 Jul 2019 14:43:49 +0200 Message-Id: <20190731124349.4474-11-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 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564577045; bh=dOauvtVe9yCPSP0ChARSYwAi6eemkfSk00etuTmxP94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDjo31Gp98T2gFdLY039cbiyj4PAacUBKvstkRQIB1ZAszuZ1lLwgJ4RrJkSdwedK d8bygUyV0zt4ievvAetFIsLr45vONXfpE6cNuMsj1/U+1gbVbvEBKFFUFaOlfvJR9x E8ronTcaI/nWIQomapLDtcVwHuImfvVG+Qvtqmtk= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 bunch of sysfs files. Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/sm501fb.c | 37 +++++++++-------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 6edb4492e675..3dd1b1d76e98 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1271,6 +1271,14 @@ static ssize_t sm501fb_debug_show_pnl(struct device *dev, static DEVICE_ATTR(fbregs_pnl, 0444, sm501fb_debug_show_pnl, NULL); +static struct attribute *sm501fb_attrs[] = { + &dev_attr_crt_src.attr, + &dev_attr_fbregs_pnl.attr, + &dev_attr_fbregs_crt.attr, + NULL, +}; +ATTRIBUTE_GROUPS(sm501fb); + /* acceleration operations */ static int sm501fb_sync(struct fb_info *info) { @@ -2011,33 +2019,9 @@ static int sm501fb_probe(struct platform_device *pdev) goto err_started_crt; } - /* create device files */ - - ret = device_create_file(dev, &dev_attr_crt_src); - if (ret) - goto err_started_panel; - - ret = device_create_file(dev, &dev_attr_fbregs_pnl); - if (ret) - goto err_attached_crtsrc_file; - - ret = device_create_file(dev, &dev_attr_fbregs_crt); - if (ret) - goto err_attached_pnlregs_file; - /* we registered, return ok */ return 0; -err_attached_pnlregs_file: - device_remove_file(dev, &dev_attr_fbregs_pnl); - -err_attached_crtsrc_file: - device_remove_file(dev, &dev_attr_crt_src); - -err_started_panel: - unregister_framebuffer(info->fb[HEAD_PANEL]); - sm501_free_init_fb(info, HEAD_PANEL); - err_started_crt: unregister_framebuffer(info->fb[HEAD_CRT]); sm501_free_init_fb(info, HEAD_CRT); @@ -2067,10 +2051,6 @@ static int sm501fb_remove(struct platform_device *pdev) struct fb_info *fbinfo_crt = info->fb[0]; struct fb_info *fbinfo_pnl = info->fb[1]; - device_remove_file(&pdev->dev, &dev_attr_fbregs_crt); - device_remove_file(&pdev->dev, &dev_attr_fbregs_pnl); - device_remove_file(&pdev->dev, &dev_attr_crt_src); - sm501_free_init_fb(info, HEAD_CRT); sm501_free_init_fb(info, HEAD_PANEL); @@ -2234,6 +2214,7 @@ static struct platform_driver sm501fb_driver = { .resume = sm501fb_resume, .driver = { .name = "sm501-fb", + .dev_groups = sm501fb_groups, }, };