On Fri Jul 4 19:10:51 2025 +0300, Abdelrahman Fekry wrote:
> Continue the cleanup of the AtomISP driver, as discussed with Hans and Andy
> in [1].
> 
> Tackle TODO item: "Remove custom sysfs files created by atomisp_drvfs.c":
> - Remove the sysfs attributes `dbglvl`, `dbgfun`, and `dbgopt`.
> - Delete their associated show/store handler functions.
> - Remove the corresponding attribute group definitions.
> 
> Link: 
> https://lore.kernel.org/all/836dc6b6-2821-47fc-8f24-0838f979a...@kernel.org/ 
> [1]
> Suggested-by: Hans de Goede <ha...@kernel.org>
> Reviewed-by: Andy Shevchenko <a...@kernel.org>
> Signed-off-by: Abdelrahman Fekry <abdelrahmanfekry...@gmail.com>
> Link: 
> https://lore.kernel.org/r/20250704161051.16733-1-abdelrahmanfekry...@gmail.com
> [ha...@kernel.org: Completely remove the now empty atomisp_drvfs files]
> Reviewed-by: Hans de Goede <ha...@kernel.org>
> Signed-off-by: Hans de Goede <ha...@kernel.org>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+hua...@kernel.org>

Patch committed.

Thanks,
Mauro Carvalho Chehab

 drivers/staging/media/atomisp/Makefile            |   1 -
 drivers/staging/media/atomisp/TODO                |   2 -
 drivers/staging/media/atomisp/pci/atomisp_drvfs.c | 155 ----------------------
 drivers/staging/media/atomisp/pci/atomisp_drvfs.h |  15 ---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c  |   4 -
 5 files changed, 177 deletions(-)

---

diff --git a/drivers/staging/media/atomisp/Makefile 
b/drivers/staging/media/atomisp/Makefile
index 43116c74781d..1d0fbe22036b 100644
--- a/drivers/staging/media/atomisp/Makefile
+++ b/drivers/staging/media/atomisp/Makefile
@@ -17,7 +17,6 @@ atomisp-objs += \
        pci/atomisp_compat_css20.o \
        pci/atomisp_csi2.o \
        pci/atomisp_csi2_bridge.o \
-       pci/atomisp_drvfs.o \
        pci/atomisp_fops.o \
        pci/atomisp_ioctl.o \
        pci/atomisp_subdev.o \
diff --git a/drivers/staging/media/atomisp/TODO 
b/drivers/staging/media/atomisp/TODO
index 27cbbde93b1e..82be275b4a0a 100644
--- a/drivers/staging/media/atomisp/TODO
+++ b/drivers/staging/media/atomisp/TODO
@@ -7,8 +7,6 @@ TODO
 
 * Remove/disable custom v4l2-ctrls
 
-* Remove custom sysfs files created by atomisp_drvfs.c
-
 * Remove unnecessary/unwanted module parameters
 
 * Remove abuse of priv field in various v4l2 userspace API structs
diff --git a/drivers/staging/media/atomisp/pci/atomisp_drvfs.c 
b/drivers/staging/media/atomisp/pci/atomisp_drvfs.c
deleted file mode 100644
index 31c82c3c0d33..000000000000
--- a/drivers/staging/media/atomisp/pci/atomisp_drvfs.c
+++ /dev/null
@@ -1,155 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Support for atomisp driver sysfs interface
- *
- * Copyright (c) 2014 Intel Corporation. All Rights Reserved.
- */
-
-#include <linux/device.h>
-#include <linux/err.h>
-#include <linux/kernel.h>
-
-#include "atomisp_compat.h"
-#include "atomisp_internal.h"
-#include "atomisp_ioctl.h"
-#include "atomisp_drvfs.h"
-#include "hmm/hmm.h"
-#include "ia_css_debug.h"
-
-#define OPTION_BIN_LIST                        BIT(0)
-#define OPTION_BIN_RUN                 BIT(1)
-#define OPTION_VALID                   (OPTION_BIN_LIST | OPTION_BIN_RUN)
-
-/*
- * dbgopt: iunit debug option:
- *        bit 0: binary list
- *        bit 1: running binary
- *        bit 2: memory statistic
- */
-static unsigned int dbgopt = OPTION_BIN_LIST;
-
-static inline int iunit_dump_dbgopt(struct atomisp_device *isp,
-                                   unsigned int opt)
-{
-       int ret = 0;
-
-       if (opt & OPTION_VALID) {
-               if (opt & OPTION_BIN_LIST) {
-                       ret = atomisp_css_dump_blob_infor(isp);
-                       if (ret) {
-                               dev_err(isp->dev, "%s dump blob infor 
err[ret:%d]\n",
-                                       __func__, ret);
-                               goto opt_err;
-                       }
-               }
-
-               if (opt & OPTION_BIN_RUN) {
-                       if (isp->asd.streaming) {
-                               atomisp_css_dump_sp_raw_copy_linecount(true);
-                               atomisp_css_debug_dump_isp_binary();
-                       } else {
-                               ret = -EPERM;
-                               dev_err(isp->dev, "%s dump running bin 
err[ret:%d]\n",
-                                       __func__, ret);
-                               goto opt_err;
-                       }
-               }
-       } else {
-               ret = -EINVAL;
-               dev_err(isp->dev, "%s dump nothing[ret=%d]\n", __func__, ret);
-       }
-
-opt_err:
-       return ret;
-}
-
-static ssize_t dbglvl_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-       unsigned int dbglvl = ia_css_debug_get_dtrace_level();
-
-       return sysfs_emit(buf, "dtrace level:%u\n", dbglvl);
-}
-
-static ssize_t dbglvl_store(struct device *dev, struct device_attribute *attr,
-                           const char *buf, size_t size)
-{
-       unsigned int dbglvl;
-       int ret;
-
-       ret = kstrtouint(buf, 10, &dbglvl);
-       if (ret)
-               return ret;
-
-       if (dbglvl < 1 || dbglvl > 9)
-               return -ERANGE;
-
-       ia_css_debug_set_dtrace_level(dbglvl);
-       return size;
-}
-static DEVICE_ATTR_RW(dbglvl);
-
-static ssize_t dbgfun_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-       unsigned int dbgfun = atomisp_get_css_dbgfunc();
-
-       return sysfs_emit(buf, "dbgfun opt:%u\n", dbgfun);
-}
-
-static ssize_t dbgfun_store(struct device *dev, struct device_attribute *attr,
-                           const char *buf, size_t size)
-{
-       struct atomisp_device *isp = dev_get_drvdata(dev);
-       unsigned int opt;
-       int ret;
-
-       ret = kstrtouint(buf, 10, &opt);
-       if (ret)
-               return ret;
-
-       return atomisp_set_css_dbgfunc(isp, opt);
-}
-static DEVICE_ATTR_RW(dbgfun);
-
-static ssize_t dbgopt_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-       return sysfs_emit(buf, "option:0x%x\n", dbgopt);
-}
-
-static ssize_t dbgopt_store(struct device *dev, struct device_attribute *attr,
-                           const char *buf, size_t size)
-{
-       struct atomisp_device *isp = dev_get_drvdata(dev);
-       unsigned int opt;
-       int ret;
-
-       ret = kstrtouint(buf, 10, &opt);
-       if (ret)
-               return ret;
-
-       dbgopt = opt;
-       ret = iunit_dump_dbgopt(isp, dbgopt);
-       if (ret)
-               return ret;
-
-       return size;
-}
-static DEVICE_ATTR_RW(dbgopt);
-
-static struct attribute *dbg_attrs[] = {
-       &dev_attr_dbglvl.attr,
-       &dev_attr_dbgfun.attr,
-       &dev_attr_dbgopt.attr,
-       NULL
-};
-
-static const struct attribute_group dbg_attr_group = {
-       .attrs = dbg_attrs,
-};
-
-const struct attribute_group *dbg_attr_groups[] = {
-       &dbg_attr_group,
-       NULL
-};
diff --git a/drivers/staging/media/atomisp/pci/atomisp_drvfs.h 
b/drivers/staging/media/atomisp/pci/atomisp_drvfs.h
deleted file mode 100644
index 46ad59b8df28..000000000000
--- a/drivers/staging/media/atomisp/pci/atomisp_drvfs.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Support for atomisp driver sysfs interface.
- *
- * Copyright (c) 2014 Intel Corporation. All Rights Reserved.
- */
-
-#ifndef        __ATOMISP_DRVFS_H__
-#define        __ATOMISP_DRVFS_H__
-
-#include <linux/sysfs.h>
-
-extern const struct attribute_group *dbg_attr_groups[];
-
-#endif /* __ATOMISP_DRVFS_H__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c 
b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 3fdaa4b7bbaf..900a67552d6a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -29,7 +29,6 @@
 #include "atomisp_internal.h"
 #include "atomisp-regs.h"
 #include "atomisp_dfs_tables.h"
-#include "atomisp_drvfs.h"
 #include "hmm/hmm.h"
 #include "atomisp_trace_event.h"
 
@@ -1497,9 +1496,6 @@ static const struct pci_device_id atomisp_pci_tbl[] = {
 MODULE_DEVICE_TABLE(pci, atomisp_pci_tbl);
 
 static struct pci_driver atomisp_pci_driver = {
-       .driver = {
-               .dev_groups = dbg_attr_groups,
-       },
        .name = "atomisp-isp2",
        .id_table = atomisp_pci_tbl,
        .probe = atomisp_pci_probe,

Reply via email to