Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1761904ybi; Wed, 3 Jul 2019 22:58:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU6DDMRhx4EzUXNdWyJQpzQlataoI2wSq69VO+T4JE+4yxE9J9zdLoisg4cumJakoNY3/Q X-Received: by 2002:a17:90a:1b48:: with SMTP id q66mr16865190pjq.83.1562219920200; Wed, 03 Jul 2019 22:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562219920; cv=none; d=google.com; s=arc-20160816; b=WeLW4cUxq3AzS14bIX2SixTkeAsms97Okrh5WKUKk19GPLswT5woO1P9naSsCv1uys hS7GaBrtaZk1VcyZsnysmgGTS4I/9xjdcbKY3q7XmZKwc+s+wgn0OugdzIr1wp/EO3Xa RuFZz02c6ZtwH5hhcYfZ3jVBBBr3vGdEtuIs+PGq8MohaZQJWwG9kth38an0IgyBOke0 HD6lslgyJF1soiF8OV7nugVs1CxHzQUVP+UTSJBfEiQ4XOKKomfUEiSdgNP89itWAChj bvVG5iCN9vYXbVARVW02N+zaY/o/pMH2sRLXuZrPaycORMiDcmnw+IwP/0SRPhjOYWSb PEqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=gHoVe4/55/1kdGGWXVPMkOqLiEYX9ssnfJ4kP9xSa60=; b=sSqYluUG64r01/QxcA7vXhVxMiCLli9nWCECTBuXzww99renvOYAt8EFXkupuZ+KGm wFJXEENbRm65e1zrgwfPHXGquahUSpdf3Nc6nSwVHWN38878nTJwP95YFQ/d/PXEsW9A QVeKFmwVv9RYn5Gd/1dMBvEXB048pOfKPeUaYCnldbOjmPrenxQV32k+Cl8HN0DoJND1 Q//q7w7Awce6QJb/vZPwt2Cq//wASMCc4aTux2q0p1/0W0Puq95xcZ3kn4VebqTPzTKd WsnR+67NzADAnVe486J+D0YMX4c92FNdtS1c5W6+Jgc6pm3Ztabk+iyYXLyu+fdY16n+ XgRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e62tZtsg; 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 i185si4610060pge.505.2019.07.03.22.58.24; Wed, 03 Jul 2019 22:58: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=e62tZtsg; 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 S1727324AbfGDF4t (ORCPT + 99 others); Thu, 4 Jul 2019 01:56:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:57962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfGDF4s (ORCPT ); Thu, 4 Jul 2019 01:56:48 -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 6DD8E2189E; Thu, 4 Jul 2019 05:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562219807; bh=HFV2mCfkWS/Ahm4inF+o0+Y8ICuqHjX4WG6iRHtx6X0=; h=Date:From:To:Cc:Subject:From; b=e62tZtsgi/AsTU/EfOWH/TT0/zZvvbNqpvSezFtIg05NjNZoZbUZAILIa8wyxCB3o +nT523hZHLWEHBTP+BxWOK0zR73qKwK2gAxx0qTELNTrfhVu6ob0quNmHUuuHCa02D r9chEwlwo02KG8ve7PHzjZ1rjO7D3OJnvkhdTW98= Date: Thu, 4 Jul 2019 07:56:45 +0200 From: Greg Kroah-Hartman To: Wu Hao , Alan Tull , Moritz Fischer Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fpga: dfl: use driver core functions, not sysfs ones. Message-ID: <20190704055645.GA15471@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a driver, do not call "raw" sysfs functions, instead call driver core ones. Specifically convert the use of sysfs_create_files() and sysfs_remove_files() to use device_add_groups() and device_remove_groups() Cc: Wu Hao Cc: Alan Tull Cc: Moritz Fischer Cc: linux-fpga@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/fpga/dfl-afu-main.c | 14 ++++++++------ drivers/fpga/dfl-fme-main.c | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c index 02baa6a227c0..68b4d0874b93 100644 --- a/drivers/fpga/dfl-afu-main.c +++ b/drivers/fpga/dfl-afu-main.c @@ -141,10 +141,11 @@ id_show(struct device *dev, struct device_attribute *attr, char *buf) } static DEVICE_ATTR_RO(id); -static const struct attribute *port_hdr_attrs[] = { +static struct attribute *port_hdr_attrs[] = { &dev_attr_id.attr, NULL, }; +ATTRIBUTE_GROUPS(port_hdr); static int port_hdr_init(struct platform_device *pdev, struct dfl_feature *feature) @@ -153,7 +154,7 @@ static int port_hdr_init(struct platform_device *pdev, port_reset(pdev); - return sysfs_create_files(&pdev->dev.kobj, port_hdr_attrs); + return device_add_groups(&pdev->dev, port_hdr_groups); } static void port_hdr_uinit(struct platform_device *pdev, @@ -161,7 +162,7 @@ static void port_hdr_uinit(struct platform_device *pdev, { dev_dbg(&pdev->dev, "PORT HDR UInit.\n"); - sysfs_remove_files(&pdev->dev.kobj, port_hdr_attrs); + device_remove_groups(&pdev->dev, port_hdr_groups); } static long @@ -214,10 +215,11 @@ afu_id_show(struct device *dev, struct device_attribute *attr, char *buf) } static DEVICE_ATTR_RO(afu_id); -static const struct attribute *port_afu_attrs[] = { +static struct attribute *port_afu_attrs[] = { &dev_attr_afu_id.attr, NULL }; +ATTRIBUTE_GROUPS(port_afu); static int port_afu_init(struct platform_device *pdev, struct dfl_feature *feature) @@ -234,7 +236,7 @@ static int port_afu_init(struct platform_device *pdev, if (ret) return ret; - return sysfs_create_files(&pdev->dev.kobj, port_afu_attrs); + return device_add_groups(&pdev->dev, port_afu_groups); } static void port_afu_uinit(struct platform_device *pdev, @@ -242,7 +244,7 @@ static void port_afu_uinit(struct platform_device *pdev, { dev_dbg(&pdev->dev, "PORT AFU UInit.\n"); - sysfs_remove_files(&pdev->dev.kobj, port_afu_attrs); + device_remove_groups(&pdev->dev, port_afu_groups); } static const struct dfl_feature_ops port_afu_ops = { diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme-main.c index 086ad2420ade..0be4635583d5 100644 --- a/drivers/fpga/dfl-fme-main.c +++ b/drivers/fpga/dfl-fme-main.c @@ -72,12 +72,13 @@ static ssize_t bitstream_metadata_show(struct device *dev, } static DEVICE_ATTR_RO(bitstream_metadata); -static const struct attribute *fme_hdr_attrs[] = { +static struct attribute *fme_hdr_attrs[] = { &dev_attr_ports_num.attr, &dev_attr_bitstream_id.attr, &dev_attr_bitstream_metadata.attr, NULL, }; +ATTRIBUTE_GROUPS(fme_hdr); static int fme_hdr_init(struct platform_device *pdev, struct dfl_feature *feature) @@ -89,7 +90,7 @@ static int fme_hdr_init(struct platform_device *pdev, dev_dbg(&pdev->dev, "FME cap %llx.\n", (unsigned long long)readq(base + FME_HDR_CAP)); - ret = sysfs_create_files(&pdev->dev.kobj, fme_hdr_attrs); + ret = device_add_groups(&pdev->dev, fme_hdr_groups); if (ret) return ret; @@ -100,7 +101,7 @@ static void fme_hdr_uinit(struct platform_device *pdev, struct dfl_feature *feature) { dev_dbg(&pdev->dev, "FME HDR UInit.\n"); - sysfs_remove_files(&pdev->dev.kobj, fme_hdr_attrs); + device_remove_groups(&pdev->dev, fme_hdr_groups); } static const struct dfl_feature_ops fme_hdr_ops = { -- 2.22.0