Skip to content

Commit 40ed9e9

Browse files
ribaldamchehab
authored andcommitted
media: uvcvideo: Announce the user our deprecation intentions
If the user sets the nodrop parameter, print a deprecation warning once. Hopefully they will come to the mailing list if it is an ABI change. Now that we have a callback, take this chance to parse the parameter as a boolean. We still say to userspace that it is a uint to avoid ABI changes. Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 8869eb6 commit 40ed9e9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

drivers/media/usb/uvc/uvc_driver.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,8 +2453,25 @@ module_param_call(clock, uvc_clock_param_set, uvc_clock_param_get,
24532453
MODULE_PARM_DESC(clock, "Video buffers timestamp clock");
24542454
module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, 0644);
24552455
MODULE_PARM_DESC(hwtimestamps, "Use hardware timestamps");
2456-
module_param_named(nodrop, uvc_no_drop_param, uint, 0644);
2456+
2457+
static int param_set_nodrop(const char *val, const struct kernel_param *kp)
2458+
{
2459+
pr_warn_once("uvcvideo: "
2460+
DEPRECATED
2461+
"nodrop parameter will be eventually removed.\n");
2462+
return param_set_bool(val, kp);
2463+
}
2464+
2465+
static const struct kernel_param_ops param_ops_nodrop = {
2466+
.set = param_set_nodrop,
2467+
.get = param_get_uint,
2468+
};
2469+
2470+
param_check_uint(nodrop, &uvc_no_drop_param);
2471+
module_param_cb(nodrop, &param_ops_nodrop, &uvc_no_drop_param, 0644);
2472+
__MODULE_PARM_TYPE(nodrop, "uint");
24572473
MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames");
2474+
24582475
module_param_named(quirks, uvc_quirks_param, uint, 0644);
24592476
MODULE_PARM_DESC(quirks, "Forced device quirks");
24602477
module_param_named(trace, uvc_dbg_param, uint, 0644);

0 commit comments

Comments
 (0)