Files
media_build/backports/v6.2_v4l2-core.patch
Etienne Champetier 44e3126209 Split vm_flags_set() backports in a separate patch
This makes building with RHEL 9.5 and derivative easier
as we only need to comment some patches in backports.txt.
2024-12-07 19:19:06 -05:00

137 lines
4.2 KiB
Diff

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 2ec179cd1264..fd90861b47c9 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -10,7 +10,6 @@
#include <linux/export.h>
#include <linux/ioctl.h>
-#include <linux/leds.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/overflow.h>
@@ -44,8 +43,6 @@ static bool v4l2_subdev_enable_streams_api;
*/
#define V4L2_SUBDEV_MAX_STREAM_ID 63
-#include "v4l2-subdev-priv.h"
-
#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
static int subdev_fh_init(struct v4l2_subdev_fh *fh, struct v4l2_subdev *sd)
{
@@ -374,15 +371,6 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)
{
int ret;
-#if IS_REACHABLE(CONFIG_LEDS_CLASS)
- if (!IS_ERR_OR_NULL(sd->privacy_led)) {
- if (enable)
- led_set_brightness(sd->privacy_led,
- sd->privacy_led->max_brightness);
- else
- led_set_brightness(sd->privacy_led, 0);
- }
-#endif
ret = sd->ops->video->s_stream(sd, enable);
if (!enable && ret < 0) {
@@ -2181,7 +2169,6 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops)
sd->grp_id = 0;
sd->dev_priv = NULL;
sd->host_priv = NULL;
- sd->privacy_led = NULL;
#if defined(CONFIG_MEDIA_CONTROLLER)
sd->entity.name = sd->name;
sd->entity.obj_type = MEDIA_ENTITY_TYPE_V4L2_SUBDEV;
@@ -2197,36 +2184,3 @@ void v4l2_subdev_notify_event(struct v4l2_subdev *sd,
v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, (void *)ev);
}
EXPORT_SYMBOL_GPL(v4l2_subdev_notify_event);
-
-int v4l2_subdev_get_privacy_led(struct v4l2_subdev *sd)
-{
-#if IS_REACHABLE(CONFIG_LEDS_CLASS)
- sd->privacy_led = led_get(sd->dev, "privacy-led");
- if (IS_ERR(sd->privacy_led) && PTR_ERR(sd->privacy_led) != -ENOENT)
- return dev_err_probe(sd->dev, PTR_ERR(sd->privacy_led),
- "getting privacy LED\n");
-
- if (!IS_ERR_OR_NULL(sd->privacy_led)) {
- mutex_lock(&sd->privacy_led->led_access);
- led_sysfs_disable(sd->privacy_led);
- led_trigger_remove(sd->privacy_led);
- led_set_brightness(sd->privacy_led, 0);
- mutex_unlock(&sd->privacy_led->led_access);
- }
-#endif
- return 0;
-}
-EXPORT_SYMBOL_GPL(v4l2_subdev_get_privacy_led);
-
-void v4l2_subdev_put_privacy_led(struct v4l2_subdev *sd)
-{
-#if IS_REACHABLE(CONFIG_LEDS_CLASS)
- if (!IS_ERR_OR_NULL(sd->privacy_led)) {
- mutex_lock(&sd->privacy_led->led_access);
- led_sysfs_enable(sd->privacy_led);
- mutex_unlock(&sd->privacy_led->led_access);
- led_put(sd->privacy_led);
- }
-#endif
-}
-EXPORT_SYMBOL_GPL(v4l2_subdev_put_privacy_led);
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index b16b5f4cb91e..008a2a3e312e 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -24,8 +24,6 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
-#include "v4l2-subdev-priv.h"
-
static int v4l2_async_nf_call_bound(struct v4l2_async_notifier *n,
struct v4l2_subdev *subdev,
struct v4l2_async_subdev *asd)
@@ -827,8 +825,6 @@ void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
if (!sd->async_list.next)
return;
- v4l2_subdev_put_privacy_led(sd);
-
mutex_lock(&list_lock);
__v4l2_async_nf_unregister(sd->subdev_notifier);
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 049c2f2001ea..3d9533c1b202 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -28,8 +28,6 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
-#include "v4l2-subdev-priv.h"
-
static const struct v4l2_fwnode_bus_conv {
enum v4l2_fwnode_bus_type fwnode_bus_type;
enum v4l2_mbus_type mbus_type;
@@ -1304,10 +1302,6 @@ int v4l2_async_register_subdev_sensor(struct v4l2_subdev *sd)
v4l2_async_nf_init(notifier);
- ret = v4l2_subdev_get_privacy_led(sd);
- if (ret < 0)
- goto out_cleanup;
-
ret = v4l2_async_nf_parse_fwnode_sensor(sd->dev, notifier);
if (ret < 0)
goto out_cleanup;
@@ -1328,7 +1322,6 @@ int v4l2_async_register_subdev_sensor(struct v4l2_subdev *sd)
v4l2_async_nf_unregister(notifier);
out_cleanup:
- v4l2_subdev_put_privacy_led(sd);
v4l2_async_nf_cleanup(notifier);
kfree(notifier);