summaryrefslogtreecommitdiff
path: root/drivers/fpga/dfl-fme-main.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-04 08:56:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-25 15:32:25 +0300
commitdcfecd4d7a551906595351a26e1db91774b8563d (patch)
tree28ce6a37efb2baf47a499b7a02b8cac5c6893e58 /drivers/fpga/dfl-fme-main.c
parent7bdd9695970eb8cd5b987e08f99cb8f0c84f30fd (diff)
downloadlinux-dcfecd4d7a551906595351a26e1db91774b8563d.tar.xz
fpga: dfl: use driver core functions, not sysfs ones.
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 <hao.wu@intel.com> Cc: Alan Tull <atull@kernel.org> Cc: Moritz Fischer <mdf@kernel.org> Cc: linux-fpga@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20190704055645.GA15471@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga/dfl-fme-main.c')
-rw-r--r--drivers/fpga/dfl-fme-main.c7
1 files changed, 4 insertions, 3 deletions
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 = {