From patchwork Mon Aug 13 09:25:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 10563941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AAF8157B for ; Mon, 13 Aug 2018 09:25:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1405028660 for ; Mon, 13 Aug 2018 09:25:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 084D628F27; Mon, 13 Aug 2018 09:25:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D69A28660 for ; Mon, 13 Aug 2018 09:25:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728834AbeHMMG7 (ORCPT ); Mon, 13 Aug 2018 08:06:59 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40653 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728819AbeHMMG7 (ORCPT ); Mon, 13 Aug 2018 08:06:59 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fp96G-0001Zj-RX; Mon, 13 Aug 2018 11:25:20 +0200 Received: from mfe by dude.hi.pengutronix.de with local (Exim 4.91) (envelope-from ) id 1fp96E-0003IB-UE; Mon, 13 Aug 2018 11:25:18 +0200 From: Marco Felsch To: mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: kernel@pengutronix.de, devicetree@vger.kernel.org, p.zabel@pengutronix.de, javierm@redhat.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, afshin.nasser@gmail.com, linux-media@vger.kernel.org Subject: [PATCH v2 4/7] [media] v4l2-subdev: fix v4l2_subdev_get_try_* dependency Date: Mon, 13 Aug 2018 11:25:05 +0200 Message-Id: <20180813092508.1334-5-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180813092508.1334-1-m.felsch@pengutronix.de> References: <20180813092508.1334-1-m.felsch@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; +} + +#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 *