From: Marco Felsch <m.felsch@pengutronix.de>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com,
kernel@pengutronix.de, devicetree@vger.kernel.org,
p.zabel@pengutronix.de, javierm@redhat.com,
laurent.pinchart@ideasonboard.com, afshin.nasser@gmail.com,
linux-media@vger.kernel.org
Subject: Re: [PATCH v2 4/7] [media] v4l2-subdev: fix v4l2_subdev_get_try_* dependency
Date: Fri, 14 Sep 2018 20:10:04 +0200 [thread overview]
Message-ID: <20180914181004.i2yemrfbrr6xltvz@pengutronix.de> (raw)
In-Reply-To: <20180914132538.5anptpaqt6cgkxow@paasikivi.fi.intel.com>
Hi Sakari,
On 18-09-14 16:25, Sakari Ailus wrote:
> Hi Marco,
>
> On Mon, Aug 13, 2018 at 11:25:05AM +0200, Marco Felsch wrote:
> > These helpers make us of the media-controller entity which is only
> > available if the CONFIG_MEDIA_CONTROLLER is enabled.
> >
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> > include/media/v4l2-subdev.h | 100 ++++++++++++++++++------------------
> > 1 file changed, 50 insertions(+), 50 deletions(-)
> >
> > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> > index ce48f1fcf295..79c066934ad2 100644
> > --- a/include/media/v4l2-subdev.h
> > +++ b/include/media/v4l2-subdev.h
> > @@ -912,6 +912,56 @@ struct v4l2_subdev_fh {
> > #define to_v4l2_subdev_fh(fh) \
> > container_of(fh, struct v4l2_subdev_fh, vfh)
> >
> > +extern const struct v4l2_file_operations v4l2_subdev_fops;
> > +
> > +/**
> > + * v4l2_set_subdevdata - Sets V4L2 dev private device data
> > + *
> > + * @sd: pointer to &struct v4l2_subdev
> > + * @p: pointer to the private device data to be stored.
> > + */
> > +static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
> > +{
> > + sd->dev_priv = p;
> > +}
> > +
> > +/**
> > + * v4l2_get_subdevdata - Gets V4L2 dev private device data
> > + *
> > + * @sd: pointer to &struct v4l2_subdev
> > + *
> > + * Returns the pointer to the private device data to be stored.
> > + */
> > +static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
> > +{
> > + return sd->dev_priv;
> > +}
> > +
> > +/**
> > + * v4l2_set_subdev_hostdata - Sets V4L2 dev private host data
> > + *
> > + * @sd: pointer to &struct v4l2_subdev
> > + * @p: pointer to the private data to be stored.
> > + */
> > +static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
> > +{
> > + sd->host_priv = p;
> > +}
> > +
> > +/**
> > + * v4l2_get_subdev_hostdata - Gets V4L2 dev private data
> > + *
> > + * @sd: pointer to &struct v4l2_subdev
> > + *
> > + * Returns the pointer to the private host data to be stored.
> > + */
> > +static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
> > +{
> > + return sd->host_priv;
> > +}
>
> Could you leave the functions dealing with host_priv where they are? I'd
> like to avoid expanding their use; rather reduce it. The field is
> problematic in some cases and generally not really needed either.
Sure, I just moved the v4l2_subdev_get_try_* formats to the
CONFIG_MEDIA_CONTROLLER ifdef block to avoid a second ifdef block (see
below). Git made it that way.. and I'm with you, the patch looks not good.
Should I open a 2nd ifdef CONFIG_MEDIA_CONTROLLER block instead?
Regards,
Marco
>
> > +
> > +#ifdef CONFIG_MEDIA_CONTROLLER
> > +
> > /**
> > * v4l2_subdev_get_try_format - ancillary routine to call
> > * &struct v4l2_subdev_pad_config->try_fmt
> > @@ -978,56 +1028,6 @@ static inline struct v4l2_rect
> > #endif
> > }
> >
> > -extern const struct v4l2_file_operations v4l2_subdev_fops;
> > -
> > -/**
> > - * v4l2_set_subdevdata - Sets V4L2 dev private device data
> > - *
> > - * @sd: pointer to &struct v4l2_subdev
> > - * @p: pointer to the private device data to be stored.
> > - */
> > -static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
> > -{
> > - sd->dev_priv = p;
> > -}
> > -
> > -/**
> > - * v4l2_get_subdevdata - Gets V4L2 dev private device data
> > - *
> > - * @sd: pointer to &struct v4l2_subdev
> > - *
> > - * Returns the pointer to the private device data to be stored.
> > - */
> > -static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
> > -{
> > - return sd->dev_priv;
> > -}
> > -
> > -/**
> > - * v4l2_set_subdev_hostdata - Sets V4L2 dev private host data
> > - *
> > - * @sd: pointer to &struct v4l2_subdev
> > - * @p: pointer to the private data to be stored.
> > - */
> > -static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
> > -{
> > - sd->host_priv = p;
> > -}
> > -
> > -/**
> > - * v4l2_get_subdev_hostdata - Gets V4L2 dev private data
> > - *
> > - * @sd: pointer to &struct v4l2_subdev
> > - *
> > - * Returns the pointer to the private host data to be stored.
> > - */
> > -static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
> > -{
> > - return sd->host_priv;
> > -}
> > -
> > -#ifdef CONFIG_MEDIA_CONTROLLER
> > -
> > /**
> > * v4l2_subdev_link_validate_default - validates a media link
> > *
>
> --
> Kind regards,
>
> Sakari Ailus
> sakari.ailus@linux.intel.com
>
next prev parent reply other threads:[~2018-09-14 23:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 9:25 [PATCH v2 0/7] TVP5150 fixes and new features Marco Felsch
2018-08-13 9:25 ` [PATCH v2 1/7] [media] tvp5150: add input source selection of_graph support Marco Felsch
2018-09-14 13:31 ` Sakari Ailus
2018-09-14 17:54 ` Marco Felsch
2018-08-13 9:25 ` [PATCH v2 2/7] [media] dt-bindings: tvp5150: Add input port connectors DT bindings Marco Felsch
2018-08-13 21:41 ` Rob Herring
2018-08-14 16:10 ` Marco Felsch
2018-08-13 9:25 ` [PATCH v2 3/7] [media] v4l2-subdev: add stubs for v4l2_subdev_get_try_* Marco Felsch
2018-08-13 9:25 ` [PATCH v2 4/7] [media] v4l2-subdev: fix v4l2_subdev_get_try_* dependency Marco Felsch
2018-09-14 13:25 ` Sakari Ailus
2018-09-14 18:10 ` Marco Felsch [this message]
2018-08-13 9:25 ` [PATCH v2 5/7] [media] tvp5150: add FORMAT_TRY support for get/set selection handlers Marco Felsch
2018-08-13 9:25 ` [PATCH v2 6/7] [media] tvp5150: initialize subdev before parsing device tree Marco Felsch
2018-08-13 9:25 ` [PATCH v2 7/7] [media] tvp5150: add s_power callback Marco Felsch
2018-09-14 13:23 ` Sakari Ailus
2018-09-14 18:20 ` Marco Felsch
2018-09-14 18:57 ` Mauro Carvalho Chehab
2018-09-18 9:51 ` Marco Felsch
2018-09-14 8:43 ` [PATCH v2 0/7] TVP5150 fixes and new features Marco Felsch
2018-09-14 9:37 ` Mauro Carvalho Chehab
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=20180914181004.i2yemrfbrr6xltvz@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=afshin.nasser@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=javierm@redhat.com \
--cc=kernel@pengutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).