]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/fpga/dfl-fme-main.c
Merge branch 'work.mount3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux.git] / drivers / fpga / dfl-fme-main.c
index f033f1cfd3ed1e0821e1496e557f73a6f4c191f1..4d78e182878f97acc2f4f2b90a626089e3c04c17 100644 (file)
@@ -127,31 +127,10 @@ static struct attribute *fme_hdr_attrs[] = {
        &dev_attr_socket_id.attr,
        NULL,
 };
-ATTRIBUTE_GROUPS(fme_hdr);
 
-static int fme_hdr_init(struct platform_device *pdev,
-                       struct dfl_feature *feature)
-{
-       void __iomem *base = feature->ioaddr;
-       int ret;
-
-       dev_dbg(&pdev->dev, "FME HDR Init.\n");
-       dev_dbg(&pdev->dev, "FME cap %llx.\n",
-               (unsigned long long)readq(base + FME_HDR_CAP));
-
-       ret = device_add_groups(&pdev->dev, fme_hdr_groups);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-
-static void fme_hdr_uinit(struct platform_device *pdev,
-                         struct dfl_feature *feature)
-{
-       dev_dbg(&pdev->dev, "FME HDR UInit.\n");
-       device_remove_groups(&pdev->dev, fme_hdr_groups);
-}
+static const struct attribute_group fme_hdr_group = {
+       .attrs = fme_hdr_attrs,
+};
 
 static long fme_hdr_ioctl_release_port(struct dfl_feature_platform_data *pdata,
                                       unsigned long arg)
@@ -199,8 +178,6 @@ static const struct dfl_feature_id fme_hdr_id_table[] = {
 };
 
 static const struct dfl_feature_ops fme_hdr_ops = {
-       .init = fme_hdr_init,
-       .uinit = fme_hdr_uinit,
        .ioctl = fme_hdr_ioctl,
 };
 
@@ -213,6 +190,10 @@ static struct dfl_feature_driver fme_feature_drvs[] = {
                .id_table = fme_pr_mgmt_id_table,
                .ops = &fme_pr_mgmt_ops,
        },
+       {
+               .id_table = fme_global_err_id_table,
+               .ops = &fme_global_err_ops,
+       },
        {
                .ops = NULL,
        },
@@ -359,9 +340,16 @@ static int fme_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct attribute_group *fme_dev_groups[] = {
+       &fme_hdr_group,
+       &fme_global_err_group,
+       NULL
+};
+
 static struct platform_driver fme_driver = {
        .driver = {
-               .name    = DFL_FPGA_FEATURE_DEV_FME,
+               .name       = DFL_FPGA_FEATURE_DEV_FME,
+               .dev_groups = fme_dev_groups,
        },
        .probe   = fme_probe,
        .remove  = fme_remove,