Skip to content

Commit

Permalink
media: v4l2-async: Remove V4L2_ASYNC_MATCH_DEVNAME
Browse files Browse the repository at this point in the history
The last user for this type of match was the soc-camera/sh_mobile_csi2
driver, which was removed in v4.9. If the support is ever needed,
it can always be restored.

[Sakari Ailus: Also drop DEVNAME from debug prints recently added.]

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Ezequiel Garcia authored and Mauro Carvalho Chehab committed Feb 6, 2021
1 parent ea12d24 commit 7e76185
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 66 deletions.
41 changes: 0 additions & 41 deletions drivers/media/v4l2-core/v4l2-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ static bool match_i2c(struct v4l2_async_notifier *notifier,
#endif
}

static bool match_devname(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *sd, struct v4l2_async_subdev *asd)
{
return !strcmp(asd->match.device_name, dev_name(sd->dev));
}

static bool match_fwnode(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *sd, struct v4l2_async_subdev *asd)
{
Expand Down Expand Up @@ -164,9 +158,6 @@ v4l2_async_find_match(struct v4l2_async_notifier *notifier,
list_for_each_entry(asd, &notifier->waiting, list) {
/* bus_type has been verified valid before */
switch (asd->match_type) {
case V4L2_ASYNC_MATCH_DEVNAME:
match = match_devname;
break;
case V4L2_ASYNC_MATCH_I2C:
match = match_i2c;
break;
Expand Down Expand Up @@ -195,9 +186,6 @@ static bool asd_equal(struct v4l2_async_subdev *asd_x,
return false;

switch (asd_x->match_type) {
case V4L2_ASYNC_MATCH_DEVNAME:
return strcmp(asd_x->match.device_name,
asd_y->match.device_name) == 0;
case V4L2_ASYNC_MATCH_I2C:
return asd_x->match.i2c.adapter_id ==
asd_y->match.i2c.adapter_id &&
Expand Down Expand Up @@ -464,7 +452,6 @@ static int v4l2_async_notifier_asd_valid(struct v4l2_async_notifier *notifier,
return -EINVAL;

switch (asd->match_type) {
case V4L2_ASYNC_MATCH_DEVNAME:
case V4L2_ASYNC_MATCH_I2C:
case V4L2_ASYNC_MATCH_FWNODE:
if (v4l2_async_notifier_has_async_subdev(notifier, asd,
Expand Down Expand Up @@ -718,31 +705,6 @@ v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
}
EXPORT_SYMBOL_GPL(v4l2_async_notifier_add_i2c_subdev);

struct v4l2_async_subdev *
v4l2_async_notifier_add_devname_subdev(struct v4l2_async_notifier *notifier,
const char *device_name,
unsigned int asd_struct_size)
{
struct v4l2_async_subdev *asd;
int ret;

asd = kzalloc(asd_struct_size, GFP_KERNEL);
if (!asd)
return ERR_PTR(-ENOMEM);

asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
asd->match.device_name = device_name;

ret = v4l2_async_notifier_add_subdev(notifier, asd);
if (ret) {
kfree(asd);
return ERR_PTR(ret);
}

return asd;
}
EXPORT_SYMBOL_GPL(v4l2_async_notifier_add_devname_subdev);

int v4l2_async_register_subdev(struct v4l2_subdev *sd)
{
struct v4l2_async_notifier *subdev_notifier;
Expand Down Expand Up @@ -841,9 +803,6 @@ static void print_waiting_subdev(struct seq_file *s,
struct v4l2_async_subdev *asd)
{
switch (asd->match_type) {
case V4L2_ASYNC_MATCH_DEVNAME:
seq_printf(s, " [devname] dev=%s\n", asd->match.device_name);
break;
case V4L2_ASYNC_MATCH_I2C:
seq_printf(s, " [i2c] dev=%d-%04x\n", asd->match.i2c.adapter_id,
asd->match.i2c.address);
Expand Down
25 changes: 0 additions & 25 deletions include/media/v4l2-async.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ struct v4l2_async_notifier;
* enum v4l2_async_match_type - type of asynchronous subdevice logic to be used
* in order to identify a match
*
* @V4L2_ASYNC_MATCH_DEVNAME: Match will use the device name
* @V4L2_ASYNC_MATCH_I2C: Match will check for I2C adapter ID and address
* @V4L2_ASYNC_MATCH_FWNODE: Match will use firmware node
*
* This enum is used by the asynchronous sub-device logic to define the
* algorithm that will be used to match an asynchronous device.
*/
enum v4l2_async_match_type {
V4L2_ASYNC_MATCH_DEVNAME,
V4L2_ASYNC_MATCH_I2C,
V4L2_ASYNC_MATCH_FWNODE,
};
Expand All @@ -43,9 +41,6 @@ enum v4l2_async_match_type {
* @match.fwnode:
* pointer to &struct fwnode_handle to be matched.
* Used if @match_type is %V4L2_ASYNC_MATCH_FWNODE.
* @match.device_name:
* string containing the device name to be matched.
* Used if @match_type is %V4L2_ASYNC_MATCH_DEVNAME.
* @match.i2c: embedded struct with I2C parameters to be matched.
* Both @match.i2c.adapter_id and @match.i2c.address
* should be matched.
Expand All @@ -69,7 +64,6 @@ struct v4l2_async_subdev {
enum v4l2_async_match_type match_type;
union {
struct fwnode_handle *fwnode;
const char *device_name;
struct {
int adapter_id;
unsigned short address;
Expand Down Expand Up @@ -218,25 +212,6 @@ v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
int adapter_id, unsigned short address,
unsigned int asd_struct_size);

/**
* v4l2_async_notifier_add_devname_subdev - Allocate and add a device-name
* async subdev to the notifier's master asd_list.
*
* @notifier: pointer to &struct v4l2_async_notifier
* @device_name: device name string to be matched
* @asd_struct_size: size of the driver's async sub-device struct, including
* sizeof(struct v4l2_async_subdev). The &struct
* v4l2_async_subdev shall be the first member of
* the driver's async sub-device struct, i.e. both
* begin at the same memory address.
*
* Same as above but for device-name matched sub-devices.
*/
struct v4l2_async_subdev *
v4l2_async_notifier_add_devname_subdev(struct v4l2_async_notifier *notifier,
const char *device_name,
unsigned int asd_struct_size);

/**
* v4l2_async_notifier_register - registers a subdevice asynchronous notifier
*
Expand Down

0 comments on commit 7e76185

Please sign in to comment.