* [PATCH 0/3] Make ACPI_PTR() use PTR_IF()
@ 2026-08-28 8:43 Sakari Ailus
2026-08-28 8:43 ` [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage Sakari Ailus
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Sakari Ailus @ 2026-08-28 8:43 UTC (permalink / raw)
To: linux-media; +Cc: linux-acpi, rafael
Hi all,
This small set makes ACPI_PTR() use PTR_IF() and so enables using
ACPI_PTR() on ACPI ID tables without marking the tables with
__maybe_unused.
The ipu-bridge patch needs to be merged first as it contains some
unsanitary use of ACPI_PTR() and that needs to be merged before the ACPI
patch.
I'd take also the ACPI patch via the Media tree if people are happy with
the approach. Otherwise there are two dependencies between the ACPI and
Media trees.
Sakari Ailus (3):
media: ipu-bridge: Drop redundant ACPI_PTR() usage
ACPI: Use PTR_IF() for ACPI_PTR()
media: i2c: Use ACPI_PTR() for ACPI ID tables
drivers/media/i2c/ccs/ccs-core.c | 2 +-
drivers/media/i2c/cvs/core.c | 4 ++--
drivers/media/i2c/gc0310.c | 2 +-
drivers/media/i2c/mt9m114.c | 2 +-
drivers/media/i2c/ov02e10.c | 2 +-
drivers/media/i2c/ov2680.c | 2 +-
drivers/media/i2c/ov2740.c | 2 +-
drivers/media/i2c/ov5693.c | 2 +-
drivers/media/i2c/ov7251.c | 2 +-
drivers/media/i2c/ov8865.c | 2 +-
drivers/media/i2c/ov9734.c | 2 +-
drivers/media/pci/intel/ipu-bridge.c | 17 ++++++++---------
include/linux/acpi.h | 5 ++---
13 files changed, 22 insertions(+), 24 deletions(-)
base-commit: 56c29fa3ee666197516a231e75aed789ae9c530d
--
2.47.3
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage 2026-08-28 8:43 [PATCH 0/3] Make ACPI_PTR() use PTR_IF() Sakari Ailus @ 2026-08-28 8:43 ` Sakari Ailus 2026-08-28 9:58 ` Rafael J. Wysocki (Intel) 2026-08-28 8:43 ` [PATCH 2/3] ACPI: Use PTR_IF() for ACPI_PTR() Sakari Ailus 2026-08-28 8:43 ` [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables Sakari Ailus 2 siblings, 1 reply; 10+ messages in thread From: Sakari Ailus @ 2026-08-28 8:43 UTC (permalink / raw) To: linux-media; +Cc: linux-acpi, rafael The ipu-bridge depends on CONFIG_ACPI, therefore ACPI_PTR(ptr) always yields ptr. Drop all use of ACPI_PTR() in the ipu-bridge. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/pci/intel/ipu-bridge.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index f9efa501e8cf..cdd654efd1dd 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -17,7 +17,7 @@ #include <media/ipu-bridge.h> #include <media/v4l2-fwnode.h> -#define ADEV_DEV(adev) ACPI_PTR(&((adev)->dev)) +#define ADEV_DEV(adev) &(adev)->dev /* * 92335fcf-3203-4472-af93-7b4453ac29da @@ -239,12 +239,12 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev for (i = 0; i < ARRAY_SIZE(ivsc_acpi_ids); i++) { const struct acpi_device_id *acpi_id = &ivsc_acpi_ids[i]; struct acpi_device *consumer, *ivsc_adev; - acpi_handle handle = acpi_device_handle(ACPI_PTR(adev)); + acpi_handle handle = acpi_device_handle(adev); for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1) /* camera sensor depends on IVSC in DSDT if exist */ for_each_acpi_consumer_dev(ivsc_adev, consumer) - if (ACPI_PTR(consumer->handle) == handle) { + if (consumer->handle == handle) { acpi_dev_put(consumer); return ivsc_adev; } @@ -322,8 +322,7 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id, acpi_status status; int ret = 0; - status = acpi_evaluate_object(ACPI_PTR(adev->handle), - id, NULL, &buffer); + status = acpi_evaluate_object(adev->handle, id, NULL, &buffer); if (ACPI_FAILURE(status)) return -ENODEV; @@ -379,7 +378,7 @@ static enum v4l2_fwnode_orientation ipu_bridge_parse_orientation(struct acpi_dev enum v4l2_fwnode_orientation orientation; struct acpi_pld_info *pld = NULL; - if (!acpi_get_physical_device_location(ACPI_PTR(adev->handle), &pld)) { + if (!acpi_get_physical_device_location(adev->handle, &pld)) { dev_warn(ADEV_DEV(adev), "_PLD call failed, using default orientation\n"); return V4L2_FWNODE_ORIENTATION_EXTERNAL; } @@ -785,7 +784,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg, int ret; for_each_acpi_dev_match(adev, cfg->hid, NULL, -1) { - if (!ACPI_PTR(adev->status.enabled)) + if (!adev->status.enabled) continue; if (bridge->n_sensors >= IPU_MAX_PORTS) { @@ -821,7 +820,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg, goto err_free_swnodes; } - sensor->adev = ACPI_PTR(acpi_dev_get(adev)); + sensor->adev = acpi_dev_get(adev); primary = acpi_fwnode_handle(adev); primary->secondary = fwnode; @@ -881,7 +880,7 @@ static int ipu_bridge_ivsc_is_ready(void) &ipu_supported_sensors[i]; for_each_acpi_dev_match(sensor_adev, cfg->hid, NULL, -1) { - if (!ACPI_PTR(sensor_adev->status.enabled)) + if (!sensor_adev->status.enabled) continue; adev = ipu_bridge_get_ivsc_acpi_dev(sensor_adev); -- 2.47.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage 2026-08-28 8:43 ` [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage Sakari Ailus @ 2026-08-28 9:58 ` Rafael J. Wysocki (Intel) 0 siblings, 0 replies; 10+ messages in thread From: Rafael J. Wysocki (Intel) @ 2026-08-28 9:58 UTC (permalink / raw) To: Sakari Ailus; +Cc: linux-media, linux-acpi, rafael On Fri, Aug 28, 2026 at 10:43 AM Sakari Ailus <sakari.ailus@linux.intel.com> wrote: > > The ipu-bridge depends on CONFIG_ACPI, therefore ACPI_PTR(ptr) always > yields ptr. Drop all use of ACPI_PTR() in the ipu-bridge. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> > --- > drivers/media/pci/intel/ipu-bridge.c | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c > index f9efa501e8cf..cdd654efd1dd 100644 > --- a/drivers/media/pci/intel/ipu-bridge.c > +++ b/drivers/media/pci/intel/ipu-bridge.c > @@ -17,7 +17,7 @@ > #include <media/ipu-bridge.h> > #include <media/v4l2-fwnode.h> > > -#define ADEV_DEV(adev) ACPI_PTR(&((adev)->dev)) > +#define ADEV_DEV(adev) &(adev)->dev > > /* > * 92335fcf-3203-4472-af93-7b4453ac29da > @@ -239,12 +239,12 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev > for (i = 0; i < ARRAY_SIZE(ivsc_acpi_ids); i++) { > const struct acpi_device_id *acpi_id = &ivsc_acpi_ids[i]; > struct acpi_device *consumer, *ivsc_adev; > - acpi_handle handle = acpi_device_handle(ACPI_PTR(adev)); > + acpi_handle handle = acpi_device_handle(adev); > > for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1) > /* camera sensor depends on IVSC in DSDT if exist */ > for_each_acpi_consumer_dev(ivsc_adev, consumer) > - if (ACPI_PTR(consumer->handle) == handle) { > + if (consumer->handle == handle) { > acpi_dev_put(consumer); > return ivsc_adev; > } > @@ -322,8 +322,7 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id, > acpi_status status; > int ret = 0; > > - status = acpi_evaluate_object(ACPI_PTR(adev->handle), > - id, NULL, &buffer); > + status = acpi_evaluate_object(adev->handle, id, NULL, &buffer); > if (ACPI_FAILURE(status)) > return -ENODEV; > > @@ -379,7 +378,7 @@ static enum v4l2_fwnode_orientation ipu_bridge_parse_orientation(struct acpi_dev > enum v4l2_fwnode_orientation orientation; > struct acpi_pld_info *pld = NULL; > > - if (!acpi_get_physical_device_location(ACPI_PTR(adev->handle), &pld)) { > + if (!acpi_get_physical_device_location(adev->handle, &pld)) { > dev_warn(ADEV_DEV(adev), "_PLD call failed, using default orientation\n"); > return V4L2_FWNODE_ORIENTATION_EXTERNAL; > } > @@ -785,7 +784,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg, > int ret; > > for_each_acpi_dev_match(adev, cfg->hid, NULL, -1) { > - if (!ACPI_PTR(adev->status.enabled)) > + if (!adev->status.enabled) > continue; > > if (bridge->n_sensors >= IPU_MAX_PORTS) { > @@ -821,7 +820,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg, > goto err_free_swnodes; > } > > - sensor->adev = ACPI_PTR(acpi_dev_get(adev)); > + sensor->adev = acpi_dev_get(adev); > > primary = acpi_fwnode_handle(adev); > primary->secondary = fwnode; > @@ -881,7 +880,7 @@ static int ipu_bridge_ivsc_is_ready(void) > &ipu_supported_sensors[i]; > > for_each_acpi_dev_match(sensor_adev, cfg->hid, NULL, -1) { > - if (!ACPI_PTR(sensor_adev->status.enabled)) > + if (!sensor_adev->status.enabled) > continue; > > adev = ipu_bridge_get_ivsc_acpi_dev(sensor_adev); > -- > 2.47.3 > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] ACPI: Use PTR_IF() for ACPI_PTR() 2026-08-28 8:43 [PATCH 0/3] Make ACPI_PTR() use PTR_IF() Sakari Ailus 2026-08-28 8:43 ` [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage Sakari Ailus @ 2026-08-28 8:43 ` Sakari Ailus 2026-08-28 9:56 ` Rafael J. Wysocki (Intel) 2026-08-28 8:43 ` [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables Sakari Ailus 2 siblings, 1 reply; 10+ messages in thread From: Sakari Ailus @ 2026-08-28 8:43 UTC (permalink / raw) To: linux-media; +Cc: linux-acpi, rafael Make ACPI_PTR() use PTR_IF() so __maybe_unused can be dropped from what is being referred to. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- include/linux/acpi.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 10d6c6c11bdf..347763282f36 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -755,7 +755,6 @@ int acpi_device_modalias(struct device *, char *, int); struct platform_device *acpi_create_platform_device(struct acpi_device *, const struct property_entry *); -#define ACPI_PTR(_ptr) (_ptr) static inline void acpi_device_set_enumerated(struct acpi_device *adev) { @@ -1073,8 +1072,6 @@ static inline int acpi_dma_configure_id(struct device *dev, return 0; } -#define ACPI_PTR(_ptr) (NULL) - static inline void acpi_device_set_enumerated(struct acpi_device *adev) { } @@ -1152,6 +1149,8 @@ static inline int acpi_mrrm_max_mem_region(void) #endif /* !CONFIG_ACPI */ +#define ACPI_PTR(_ptr) PTR_IF(IS_BUILTIN(CONFIG_ACPI), _ptr) + #ifdef CONFIG_ACPI_HMAT int hmat_get_extended_linear_cache_size(struct resource *backing_res, int nid, resource_size_t *size); -- 2.47.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] ACPI: Use PTR_IF() for ACPI_PTR() 2026-08-28 8:43 ` [PATCH 2/3] ACPI: Use PTR_IF() for ACPI_PTR() Sakari Ailus @ 2026-08-28 9:56 ` Rafael J. Wysocki (Intel) 0 siblings, 0 replies; 10+ messages in thread From: Rafael J. Wysocki (Intel) @ 2026-08-28 9:56 UTC (permalink / raw) To: Sakari Ailus; +Cc: linux-media, linux-acpi, rafael On Fri, Aug 28, 2026 at 10:43 AM Sakari Ailus <sakari.ailus@linux.intel.com> wrote: > > Make ACPI_PTR() use PTR_IF() so __maybe_unused can be dropped from what is > being referred to. > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> > --- > include/linux/acpi.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index 10d6c6c11bdf..347763282f36 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -755,7 +755,6 @@ int acpi_device_modalias(struct device *, char *, int); > > struct platform_device *acpi_create_platform_device(struct acpi_device *, > const struct property_entry *); > -#define ACPI_PTR(_ptr) (_ptr) > > static inline void acpi_device_set_enumerated(struct acpi_device *adev) > { > @@ -1073,8 +1072,6 @@ static inline int acpi_dma_configure_id(struct device *dev, > return 0; > } > > -#define ACPI_PTR(_ptr) (NULL) > - > static inline void acpi_device_set_enumerated(struct acpi_device *adev) > { > } > @@ -1152,6 +1149,8 @@ static inline int acpi_mrrm_max_mem_region(void) > > #endif /* !CONFIG_ACPI */ > > +#define ACPI_PTR(_ptr) PTR_IF(IS_BUILTIN(CONFIG_ACPI), _ptr) > + > #ifdef CONFIG_ACPI_HMAT > int hmat_get_extended_linear_cache_size(struct resource *backing_res, int nid, > resource_size_t *size); > -- > 2.47.3 > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables 2026-08-28 8:43 [PATCH 0/3] Make ACPI_PTR() use PTR_IF() Sakari Ailus 2026-08-28 8:43 ` [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage Sakari Ailus 2026-08-28 8:43 ` [PATCH 2/3] ACPI: Use PTR_IF() for ACPI_PTR() Sakari Ailus @ 2026-08-28 8:43 ` Sakari Ailus 2026-08-28 13:30 ` Andy Shevchenko 2 siblings, 1 reply; 10+ messages in thread From: Sakari Ailus @ 2026-08-28 8:43 UTC (permalink / raw) To: linux-media; +Cc: linux-acpi, rafael Add ACPI_PTR() to the ACPI ID tables where missing. The patch has been produced with the following command: git grep -lP 'acpi_match_table.*=\s*(?!ACPI_PTR)' \ drivers/media/|while read i; do perl -i -pe 's/\.acpi_match_table\s*=\s*\K(\w+),/ACPI_PTR($1),/' $i; done Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/i2c/ccs/ccs-core.c | 2 +- drivers/media/i2c/cvs/core.c | 4 ++-- drivers/media/i2c/gc0310.c | 2 +- drivers/media/i2c/mt9m114.c | 2 +- drivers/media/i2c/ov02e10.c | 2 +- drivers/media/i2c/ov2680.c | 2 +- drivers/media/i2c/ov2740.c | 2 +- drivers/media/i2c/ov5693.c | 2 +- drivers/media/i2c/ov7251.c | 2 +- drivers/media/i2c/ov8865.c | 2 +- drivers/media/i2c/ov9734.c | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 8e25f970fd12..1d68d981d7f2 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -3679,7 +3679,7 @@ static const struct dev_pm_ops ccs_pm_ops = { static struct i2c_driver ccs_i2c_driver = { .driver = { - .acpi_match_table = ccs_acpi_table, + .acpi_match_table = ACPI_PTR(ccs_acpi_table), .of_match_table = ccs_of_table, .name = CCS_NAME, .pm = &ccs_pm_ops, diff --git a/drivers/media/i2c/cvs/core.c b/drivers/media/i2c/cvs/core.c index 7486815b16bd..390cd0ff2c6e 100644 --- a/drivers/media/i2c/cvs/core.c +++ b/drivers/media/i2c/cvs/core.c @@ -973,7 +973,7 @@ MODULE_DEVICE_TABLE(acpi, intel_cvs_acpi_match); static struct i2c_driver cvs_driver = { .driver = { .name = "intel_cvs", - .acpi_match_table = intel_cvs_acpi_match, + .acpi_match_table = ACPI_PTR(intel_cvs_acpi_match), .pm = pm_ptr(&cvs_pm_ops), }, .probe = cvs_probe, @@ -1000,7 +1000,7 @@ static void cvs_platform_remove(struct platform_device *pdev) static struct platform_driver cvs_platform_driver = { .driver = { .name = "cvs_platform", - .acpi_match_table = intel_cvs_acpi_match, + .acpi_match_table = ACPI_PTR(intel_cvs_acpi_match), .pm = pm_ptr(&cvs_pm_ops), }, .probe = cvs_platform_probe, diff --git a/drivers/media/i2c/gc0310.c b/drivers/media/i2c/gc0310.c index 754e82ad50ae..0f756a250536 100644 --- a/drivers/media/i2c/gc0310.c +++ b/drivers/media/i2c/gc0310.c @@ -768,7 +768,7 @@ static struct i2c_driver gc0310_driver = { .driver = { .name = "gc0310", .pm = pm_sleep_ptr(&gc0310_pm_ops), - .acpi_match_table = gc0310_acpi_match, + .acpi_match_table = ACPI_PTR(gc0310_acpi_match), }, .probe = gc0310_probe, .remove = gc0310_remove, diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index e395e2d14e97..65aee72627d7 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -2684,7 +2684,7 @@ static struct i2c_driver mt9m114_driver = { .name = "mt9m114", .pm = &mt9m114_pm_ops, .of_match_table = mt9m114_of_ids, - .acpi_match_table = mt9m114_acpi_ids, + .acpi_match_table = ACPI_PTR(mt9m114_acpi_ids), }, .probe = mt9m114_probe, .remove = mt9m114_remove, diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c index 4a64cba99991..5e1ad6bdaaa1 100644 --- a/drivers/media/i2c/ov02e10.c +++ b/drivers/media/i2c/ov02e10.c @@ -939,7 +939,7 @@ static struct i2c_driver ov02e10_i2c_driver = { .driver = { .name = "ov02e10", .pm = pm_sleep_ptr(&ov02e10_pm_ops), - .acpi_match_table = ov02e10_acpi_ids, + .acpi_match_table = ACPI_PTR(ov02e10_acpi_ids), .of_match_table = ov02e10_of_match, }, .probe = ov02e10_probe, diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index 78e63bd1b35b..6dd7f454242a 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -1312,7 +1312,7 @@ static struct i2c_driver ov2680_i2c_driver = { .name = "ov2680", .pm = pm_sleep_ptr(&ov2680_pm_ops), .of_match_table = ov2680_dt_ids, - .acpi_match_table = ov2680_acpi_ids, + .acpi_match_table = ACPI_PTR(ov2680_acpi_ids), }, .probe = ov2680_probe, .remove = ov2680_remove, diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index 39003c1632ad..371f9f394aea 100644 --- a/drivers/media/i2c/ov2740.c +++ b/drivers/media/i2c/ov2740.c @@ -1470,7 +1470,7 @@ MODULE_DEVICE_TABLE(acpi, ov2740_acpi_ids); static struct i2c_driver ov2740_i2c_driver = { .driver = { .name = "ov2740", - .acpi_match_table = ov2740_acpi_ids, + .acpi_match_table = ACPI_PTR(ov2740_acpi_ids), .pm = pm_sleep_ptr(&ov2740_pm_ops), }, .probe = ov2740_probe, diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 4cc796bbee92..5609c5ba5795 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c @@ -1409,7 +1409,7 @@ MODULE_DEVICE_TABLE(of, ov5693_of_match); static struct i2c_driver ov5693_driver = { .driver = { .name = "ov5693", - .acpi_match_table = ov5693_acpi_match, + .acpi_match_table = ACPI_PTR(ov5693_acpi_match), .of_match_table = ov5693_of_match, .pm = &ov5693_pm_ops, }, diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c index 27afc3fc0175..ddd2c91ec057 100644 --- a/drivers/media/i2c/ov7251.c +++ b/drivers/media/i2c/ov7251.c @@ -1809,7 +1809,7 @@ MODULE_DEVICE_TABLE(acpi, ov7251_acpi_match); static struct i2c_driver ov7251_i2c_driver = { .driver = { .of_match_table = ov7251_of_match, - .acpi_match_table = ov7251_acpi_match, + .acpi_match_table = ACPI_PTR(ov7251_acpi_match), .name = "ov7251", .pm = &ov7251_pm_ops, }, diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c index c6d53c3d55ca..b676db6b2a08 100644 --- a/drivers/media/i2c/ov8865.c +++ b/drivers/media/i2c/ov8865.c @@ -3144,7 +3144,7 @@ static struct i2c_driver ov8865_driver = { .driver = { .name = "ov8865", .of_match_table = ov8865_of_match, - .acpi_match_table = ov8865_acpi_match, + .acpi_match_table = ACPI_PTR(ov8865_acpi_match), .pm = &ov8865_pm_ops, }, .probe = ov8865_probe, diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c index 0eaf33807fc9..b37ca79ceaad 100644 --- a/drivers/media/i2c/ov9734.c +++ b/drivers/media/i2c/ov9734.c @@ -980,7 +980,7 @@ MODULE_DEVICE_TABLE(acpi, ov9734_acpi_ids); static struct i2c_driver ov9734_i2c_driver = { .driver = { .name = "ov9734", - .acpi_match_table = ov9734_acpi_ids, + .acpi_match_table = ACPI_PTR(ov9734_acpi_ids), }, .probe = ov9734_probe, .remove = ov9734_remove, -- 2.47.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables 2026-08-28 8:43 ` [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables Sakari Ailus @ 2026-08-28 13:30 ` Andy Shevchenko 2026-08-28 15:10 ` Sakari Ailus 0 siblings, 1 reply; 10+ messages in thread From: Andy Shevchenko @ 2026-08-28 13:30 UTC (permalink / raw) To: Sakari Ailus; +Cc: linux-media, linux-acpi, rafael On Fri, Aug 28, 2026 at 11:43:28AM +0300, Sakari Ailus wrote: > Add ACPI_PTR() to the ACPI ID tables where missing. The patch has been > produced with the following command: > > git grep -lP 'acpi_match_table.*=\s*(?!ACPI_PTR)' \ > drivers/media/|while read i; do > perl -i -pe 's/\.acpi_match_table\s*=\s*\K(\w+),/ACPI_PTR($1),/' $i; > done NAK. It doesn't explain why we need that. This also inconsistent with OF type of IDs. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables 2026-08-28 13:30 ` Andy Shevchenko @ 2026-08-28 15:10 ` Sakari Ailus 2026-08-28 15:22 ` Andy Shevchenko 0 siblings, 1 reply; 10+ messages in thread From: Sakari Ailus @ 2026-08-28 15:10 UTC (permalink / raw) To: Andy Shevchenko; +Cc: linux-media, linux-acpi, rafael Hi Andy, On Fri, Aug 28, 2026 at 03:30:10PM +0200, Andy Shevchenko wrote: > On Fri, Aug 28, 2026 at 11:43:28AM +0300, Sakari Ailus wrote: > > Add ACPI_PTR() to the ACPI ID tables where missing. The patch has been > > produced with the following command: > > > > git grep -lP 'acpi_match_table.*=\s*(?!ACPI_PTR)' \ > > drivers/media/|while read i; do > > perl -i -pe 's/\.acpi_match_table\s*=\s*\K(\w+),/ACPI_PTR($1),/' $i; > > done > > NAK. > > It doesn't explain why we need that. This also inconsistent with OF type of > IDs. ACPI IDs are used on ACPI only while compatible strings are used on both ACPI and OF. Thus the ACPI ID table is redundant if CONFIG_ACPI is disabled. -- Sakari Ailus ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables 2026-08-28 15:10 ` Sakari Ailus @ 2026-08-28 15:22 ` Andy Shevchenko 2026-08-28 15:44 ` Sakari Ailus 0 siblings, 1 reply; 10+ messages in thread From: Andy Shevchenko @ 2026-08-28 15:22 UTC (permalink / raw) To: Sakari Ailus; +Cc: linux-media, linux-acpi, rafael On Fri, Aug 28, 2026 at 06:10:55PM +0300, Sakari Ailus wrote: > On Fri, Aug 28, 2026 at 03:30:10PM +0200, Andy Shevchenko wrote: > > On Fri, Aug 28, 2026 at 11:43:28AM +0300, Sakari Ailus wrote: > > > Add ACPI_PTR() to the ACPI ID tables where missing. The patch has been > > > produced with the following command: > > > > > > git grep -lP 'acpi_match_table.*=\s*(?!ACPI_PTR)' \ > > > drivers/media/|while read i; do > > > perl -i -pe 's/\.acpi_match_table\s*=\s*\K(\w+),/ACPI_PTR($1),/' $i; > > > done > > > > NAK. > > > > It doesn't explain why we need that. This also inconsistent with OF type of > > IDs. > > ACPI IDs are used on ACPI only while compatible strings are used on both > ACPI and OF. Thus the ACPI ID table is redundant if CONFIG_ACPI is > disabled. They may be informative for the cases when on the working say OF system I can get the IDs for ACPI based platforms at run-time. Also you just save a couple of dozens of bytes. This is peanuts and unneeded churn. Again, here is my formal NAKed-by: Andy Shevchenko <andriy.shevchenko@intel.com> In case you want to override that, please keep it in the commit message (among other tags). And yes, we have such a tag in the Git history of Linux kernel. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables 2026-08-28 15:22 ` Andy Shevchenko @ 2026-08-28 15:44 ` Sakari Ailus 0 siblings, 0 replies; 10+ messages in thread From: Sakari Ailus @ 2026-08-28 15:44 UTC (permalink / raw) To: Andy Shevchenko; +Cc: linux-media, linux-acpi, rafael On Fri, Aug 28, 2026 at 06:22:43PM +0300, Andy Shevchenko wrote: > On Fri, Aug 28, 2026 at 06:10:55PM +0300, Sakari Ailus wrote: > > On Fri, Aug 28, 2026 at 03:30:10PM +0200, Andy Shevchenko wrote: > > > On Fri, Aug 28, 2026 at 11:43:28AM +0300, Sakari Ailus wrote: > > > > Add ACPI_PTR() to the ACPI ID tables where missing. The patch has been > > > > produced with the following command: > > > > > > > > git grep -lP 'acpi_match_table.*=\s*(?!ACPI_PTR)' \ > > > > drivers/media/|while read i; do > > > > perl -i -pe 's/\.acpi_match_table\s*=\s*\K(\w+),/ACPI_PTR($1),/' $i; > > > > done > > > > > > NAK. > > > > > > It doesn't explain why we need that. This also inconsistent with OF type of > > > IDs. > > > > ACPI IDs are used on ACPI only while compatible strings are used on both > > ACPI and OF. Thus the ACPI ID table is redundant if CONFIG_ACPI is > > disabled. > > They may be informative for the cases when on the working say OF system I can > get the IDs for ACPI based platforms at run-time. That's a bit far-fetched I think. Have you ever done that? :-) Media drivers are probably one of the largest groups of drivers that are as relevant for ACPI as they are for OF. The of_match_ptr() that used to be present in nearly all media drivers has been largely eliminated in the same context and the only reason for that is that the table is also relevant for ACPI systems. The case is indeed the opposite to the ACPI equivalent so I really don't see why we shouldn't just drop it where it's, well, redundant. > > Also you just save a couple of dozens of bytes. This is peanuts and unneeded > churn. Again, here is my formal I recall you often comment on struct field ordering to save, well, typically less than dozens of bytes, too. > > NAKed-by: Andy Shevchenko <andriy.shevchenko@intel.com> > > In case you want to override that, please keep it in the commit message (among > other tags). And yes, we have such a tag in the Git history of Linux kernel. -- Sakari Ailus ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-08-28 15:44 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-28 8:43 [PATCH 0/3] Make ACPI_PTR() use PTR_IF() Sakari Ailus 2026-08-28 8:43 ` [PATCH 1/3] media: ipu-bridge: Drop redundant ACPI_PTR() usage Sakari Ailus 2026-08-28 9:58 ` Rafael J. Wysocki (Intel) 2026-08-28 8:43 ` [PATCH 2/3] ACPI: Use PTR_IF() for ACPI_PTR() Sakari Ailus 2026-08-28 9:56 ` Rafael J. Wysocki (Intel) 2026-08-28 8:43 ` [PATCH 3/3] media: i2c: Use ACPI_PTR() for ACPI ID tables Sakari Ailus 2026-08-28 13:30 ` Andy Shevchenko 2026-08-28 15:10 ` Sakari Ailus 2026-08-28 15:22 ` Andy Shevchenko 2026-08-28 15:44 ` Sakari Ailus
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.