Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5947009ybi; Wed, 31 Jul 2019 05:57:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP8OAZe7A61joTTjQn6kao7he+38EEbhVn4WbpBhra/n4HWnWG9ZMNe0pkAUF3IqPte+c0 X-Received: by 2002:a17:902:42d:: with SMTP id 42mr114953722ple.228.1564577856826; Wed, 31 Jul 2019 05:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564577856; cv=none; d=google.com; s=arc-20160816; b=CYJJvWIj6QFSlmLM4Ci8s7qf6Bt2wUg0LEAyafmRnin9mN4qdmGS3tAQhccWhnDAtd l9zgiHlcSasa1Hn5gKxmXXnopTYwqCngK03TZLK1I6sXiY4OjmxhIRZ2thXKPG9vN3mD DPxmbklQcCmoRH+xOcRSq4q6qWkILUAqyWBERcjlK76iHxGHbBd1EoZHB2fp9zkLC7B/ ibfDu8SevYg6ruQshDFzNrLrNily2XEcrESrAuiGX6H2wVt3RGjSYbHnvbKzRtQGcf0Z hdgmtWOuTwcGy6VogtSPURg5hCOyy2Nl2yecKOhK7a1bcd4a5i6TbESKcLIzzKXi2aSP SJDQ== 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=XllunejcXQ1ZMKnKNqVhcxewN9rFgdIRYxEKZQEQK3c=; b=0LrDDW0RBP2yrwOEBtjJidBl2sNYfi5lV+Pzi3FCJfWAqD4hov0GacsZ7cM+Agx/A7 2s5AIVG/iHy9cRoXLjANCYR7xhXWKmVIE1uw2iBe/qHeJQl9KHGFll9enEq5E0rEAR+Z kkceu+dP9ng7SqxcPKORjTxE15R9HqZQTh3XEGQKENKhC8WLx0uCJsNnX7SMj9Y0WCSr J9IooO2omlO/+7t+HZBrYk6t45jE4bAmQg8HBD0F2plv9dWnmNA/rHOvbLe+wkkCWyXH 0/nw8cuxOo6ytA52QMI1XT4+qF/Z+JMHZszf5H3GOPJ3LzTLg4Cmy+SHYxCVwSS4tfkr wPug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CT0cwL2e; 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 f12si34241227pfq.187.2019.07.31.05.57.21; Wed, 31 Jul 2019 05:57:36 -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=CT0cwL2e; 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 S1729067AbfGaMo3 (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:36868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388031AbfGaMoX (ORCPT ); Wed, 31 Jul 2019 08:44:23 -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 BCEA32171F; Wed, 31 Jul 2019 12:44:22 +0000 (UTC) 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= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman , Tony Prisk , Bartlomiej Zolnierkiewicz , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org 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 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 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, }, }; -- 2.22.0