All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: linux-media@vger.kernel.org
Cc: g.liakhovetski@gmx.de, prabhakar.csengg@gmail.com,
	laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl,
	kyungmin.park@samsung.com,
	Sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: [PATCH RFC 1/5] V4L2: Drop bus_type check in v4l2-async match functions
Date: Mon, 22 Jul 2013 20:04:43 +0200	[thread overview]
Message-ID: <1374516287-7638-2-git-send-email-s.nawrocki@samsung.com> (raw)
In-Reply-To: <1374516287-7638-1-git-send-email-s.nawrocki@samsung.com>

These match_* functions are internal callbacks and are always
invoked only after checking asd->bus_type. So drop redundant
checks in match_i2c() and match_platform() functions.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/media/v4l2-core/v4l2-async.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index aae2417..ff87c29 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -27,7 +27,6 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
 #if IS_ENABLED(CONFIG_I2C)
 	struct i2c_client *client = i2c_verify_client(dev);
 	return client &&
-		asd->bus_type == V4L2_ASYNC_BUS_I2C &&
 		asd->match.i2c.adapter_id == client->adapter->nr &&
 		asd->match.i2c.address == client->addr;
 #else
@@ -37,8 +36,7 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd)
 
 static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd)
 {
-	return asd->bus_type == V4L2_ASYNC_BUS_PLATFORM &&
-		!strcmp(asd->match.platform.name, dev_name(dev));
+	return !strcmp(asd->match.platform.name, dev_name(dev));
 }
 
 static LIST_HEAD(subdev_list);
-- 
1.7.9.5


  reply	other threads:[~2013-07-22 18:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 18:04 [PATCH RFC 0/5] v4l2-async DT support improvement and cleanups Sylwester Nawrocki
2013-07-22 18:04 ` Sylwester Nawrocki [this message]
2013-07-22 18:04 ` [PATCH RFC 2/5] V4L2: Rename v4l2_async_bus_* to v4l2_async_match_* Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 3/5] V4L2: Add V4L2_ASYNC_MATCH_OF subdev matching type Sylwester Nawrocki
2013-07-24 11:21   ` Guennadi Liakhovetski
2013-07-25  9:45     ` Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 4/5] V4L2: Rename subdev field of struct v4l2_async_notifier Sylwester Nawrocki
2013-07-23 15:50   ` Prabhakar Lad
2013-07-24  9:39     ` Sylwester Nawrocki
2013-07-24 11:26   ` Guennadi Liakhovetski
2013-07-25  9:52     ` Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 5/5] V4L2: Fold struct v4l2_async_subdev_list with struct v4l2_subdev Sylwester Nawrocki
2013-07-23 15:44 ` [PATCH RFC 0/5] v4l2-async DT support improvement and cleanups Prabhakar Lad
2013-07-24 10:06 ` Laurent Pinchart
2013-07-25  9:33   ` Sylwester Nawrocki
2013-07-24 10:16 ` Hans Verkuil
2013-07-25  9:38   ` Sylwester Nawrocki
2013-07-24 11:36 ` Guennadi Liakhovetski
2013-07-25 10:01   ` Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374516287-7638-2-git-send-email-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.