From patchwork Thu Jul 4 14:26:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11031541 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 ED78E1580 for ; Thu, 4 Jul 2019 14:26:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC9832888D for ; Thu, 4 Jul 2019 14:26:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF56828A89; Thu, 4 Jul 2019 14:26:10 +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 7F0452888D for ; Thu, 4 Jul 2019 14:26:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BADA06E357; Thu, 4 Jul 2019 14:26:07 +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 594346E357 for ; Thu, 4 Jul 2019 14:26:06 +0000 (UTC) Received: from localhost (unknown [89.205.128.15]) (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 63147218A3; Thu, 4 Jul 2019 14:26:05 +0000 (UTC) Date: Thu, 4 Jul 2019 16:26:02 +0200 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Tony Prisk , Bartlomiej Zolnierkiewicz Subject: [PATCH 07/11] video: fbdev: wm8505fb: convert platform driver to use dev_groups Message-ID: <20190704142602.GB6281@kroah.com> References: <20190704084617.3602-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190704084617.3602-1-gregkh@linuxfoundation.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562250366; bh=aSahAsJiapc2XUdQK1vHyWtY3qG19qgnLRWrZ9lBkRQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T6D0qe9q4yb+hfC0BKGldTcTyrH2DMbA4FPBD/B2aoAs6g4W0eAzsdzxaPj10gzwY 86Ejtlg0M/JZFA9dsB2z3trD5PXKR/FPA1dlAlgp4CEl3XYSrRjdytB1wbPcov4lx0 3E4u9ouWSmsdg4aGWD8A5VV+7KVChd/A89CeAncI= 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, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Darren Hart , Andy Shevchenko 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 Signed-off-by: Greg Kroah-Hartman Acked-by: Bartlomiej Zolnierkiewicz --- 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 8f0d5379861d..3b826da97035 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c @@ -184,6 +184,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; @@ -369,10 +375,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); @@ -384,8 +386,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); @@ -402,6 +402,7 @@ static const struct of_device_id wmt_dt_ids[] = { }; static struct platform_driver wm8505fb_driver = { + .dev_groups = wm8505fb_groups, .probe = wm8505fb_probe, .remove = wm8505fb_remove, .driver = {