Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5946232ybi; Wed, 31 Jul 2019 05:56:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXbqNvra+7p9bodBqpT1Tv1fZzVyBhLYYYUI0bOWlGZHtyv+fAtC2iBi0vCMAN32Do4ogy X-Received: by 2002:a17:902:a5c7:: with SMTP id t7mr121977106plq.288.1564577800546; Wed, 31 Jul 2019 05:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564577800; cv=none; d=google.com; s=arc-20160816; b=I64kMbc/5JB9BqOzFaFMdNPbosvbLmfvmH4DBtV4YPkOlNbAQeR/peVD3tDwlFxWUk fvDD/7DKAc29Ia0NDjkNV51dOgjnXCUOiqCJ72UQwtzw4DPN1a90dc4DwFzYEjQnYclM rf6pq52hr1qCn9zqjZqfo55DBf+hj9VriU/FxKiR8vVVrId/q4YPe7RuxZXTQXOUFCte cO7JFo03qU/FXd7PxWCdzPdZ404GsoAgWZYtlLl9VHuHumd9Zv39OMQsQYww1sSDvuxa 1VWOQ92DvJqccaS/C0sdTdECp3ooUY8t2mxZsQ0x5XWHAdNYHP24vafp65+XiuHRD/I0 3cQg== 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=mcZSyQYM5SiURmlK9HH9Fx8YrLJk8/zehwatlxeHcsU=; b=TEzFhcxFiGouJLQZHrVqH7p1rZAb/xn1HB9q9t4R3B29Jb/1qh6aJJvV/exYek3Uju XustjfSXcyxGncj0YM+HriUL7gyqdWNIyl4YRxiMb47DenBEAhCXQHQuMvSulDzmUsAl wfA9Ahx/9WLcODhKaLFGb6gGyDpqv3zpw2j+LsAcy3eY8XonX1XomQsofhpvI4Pll3TH aOvJC51ltgjAdrPRNVMLrwrC6X4za/qRGU8Na960NP+cZrehnY8PwaL6To9JwzzEFbt2 1xCQtHbjz2WSo/Fc/zFwiNFDgynH3n5Q3HSSSuG6qnmnp8RqHuhQIsSd7XqhsTYPAuW2 gefg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IeGNaHqO; 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 h1si28903940pls.183.2019.07.31.05.56.25; Wed, 31 Jul 2019 05:56:40 -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=IeGNaHqO; 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 S2387552AbfGaMoe (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:36926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729012AbfGaMo0 (ORCPT ); Wed, 31 Jul 2019 08:44:26 -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 5EAFE217D4; Wed, 31 Jul 2019 12:44:25 +0000 (UTC) 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= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman , Tony Prisk , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz 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 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 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, }, }; -- 2.22.0