Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6047883ybi; Wed, 31 Jul 2019 07:32:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKzEqFM+ATaTMDXtYx8RB07xGcz007O0wEm/g1jb/tAnKkeXvaVcNjw8T74GidvT9Lo01w X-Received: by 2002:a17:902:a607:: with SMTP id u7mr121553718plq.43.1564583525546; Wed, 31 Jul 2019 07:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564583525; cv=none; d=google.com; s=arc-20160816; b=c8g1++uC80mbvPsDpo7i1dG5z9LnJ18rhZqJ4Tb8vYZw6qewafAxvC57qS8NxitvrN mjwkdWHZqmjO6NQg5uusTiRjC42ZOGWMZPThFHDxlrulRrxqSrlkiIRiysCY5G8UNe6Q MQYQsRaqrsvAz6HKr8DUESRebCu8Q0KN3Ki3mkFPEipv3HyCdbH3bHvlTyusu6IhFg/q nD5U+W/wM1XD6VmSaUa+sysxtL4p7Ytz0n89qLPVwxbbm8McNoGyiwL7dDv63SqR6Kvy wX3Hyaz7U7cCRF2ZwrNrRi7Bvm3gIVqSiSYCQt3/zIDYyVfVraVWbwch7fY2+Iw1liRn 058Q== 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=LnfitPedxoEOG6/Q8MV1Vcoi4xjxYRKsfseiw/X/BH8=; b=iVNMGl8Z2QUU1O00I7efyaJq0zk4OzGfL5FfwlHfKJSi58x+BnlroBy2f+/+bmjpWG P9oAfz2hOp+61r8YBZjNrZ5wqhk4OvgJTofefM8W5n1lgu43W1xH68J7arRJ+CTDc10K 8553wGCjEeJq/681+zWv9da27wSKwYW6Gj2uDC3w//Qjz4/o6R2VTz2deur/DixUA1vD azZKBylQByTG0u3nk2uFy9O2UrbT5Bl9agvGLUGiQgF7ZgcEHVXCXTOX2BIgAtN8helW MWXg9IvUDuWwIL6WI3t9alI63W+C+BCdfm4W6EZ+k8HPxVrXB69sWdJIX8PZ39J3AOZ5 rALw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rDjo31Gp; 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 r11si8664350pgp.390.2019.07.31.07.31.50; Wed, 31 Jul 2019 07:32:05 -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=rDjo31Gp; 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 S2387982AbfGaMoH (ORCPT + 99 others); Wed, 31 Jul 2019 08:44:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:36354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387466AbfGaMoG (ORCPT ); Wed, 31 Jul 2019 08:44:06 -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 D3CD6208E3; Wed, 31 Jul 2019 12:44:04 +0000 (UTC) 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= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Richard Gong , Dmitry Torokhov Cc: Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz 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 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: 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, }, }; -- 2.22.0