From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v4 1/6] drm/dsi: check for CONFIG_OF when defining of_mipi_dsi_device_add Date: Thu, 21 Jan 2016 16:31:20 +0100 Message-ID: <20160121153118.GA647@ulmo.nvidia.com> References: <1448884892-7731-1-git-send-email-architt@codeaurora.org> <1449751300-2841-1-git-send-email-architt@codeaurora.org> <1449751300-2841-2-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Return-path: In-Reply-To: <1449751300-2841-2-git-send-email-architt@codeaurora.org> Content-Disposition: inline Sender: linux-arm-msm-owner@vger.kernel.org To: Archit Taneja Cc: dri-devel@lists.freedesktop.org, a.hajda@samsung.com, jani.nikula@linux.intel.com, linux-kernel@vger.kernel.org, airlied@linux.ie, daniel@ffwll.ch, l.stach@pengutronix.de, robh@kernel.org, linux-arm-msm@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 10, 2015 at 06:11:35PM +0530, Archit Taneja wrote: > of_mipi_dsi_device_add is used only when CONFIG_OF is enabled. It > currently works if OF support is disabled, but this will change > when we add more functionality to it. >=20 > Define the original func if CONFIG_OF is enabled. Define a dummy func > otherwise. >=20 > Signed-off-by: Archit Taneja > --- > drivers/gpu/drm/drm_mipi_dsi.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_ds= i.c > index 2d5ca8ee..bced235 100644 > --- a/drivers/gpu/drm/drm_mipi_dsi.c > +++ b/drivers/gpu/drm/drm_mipi_dsi.c > @@ -129,6 +129,7 @@ static int mipi_dsi_device_add(struct mipi_dsi_device= *dsi) > return device_add(&dsi->dev); > } > =20 > +#if IS_ENABLED(CONFIG_OF) > static struct mipi_dsi_device * > of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *n= ode) > { > @@ -170,6 +171,13 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, s= truct device_node *node) > =20 > return dsi; > } > +#else > +static struct mipi_dsi_device * > +of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *n= ode) > +{ > + return NULL; > +} > +#endif The OF implementation of this function never returns NULL, so perhaps this should return an ERR_PTR()-encoded error code instead? This isn't really important because we never check the return value in the one call-site that we have, which I guess could be an argument for removing the return value altogether... Thierry --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJWoPnEAAoJEN0jrNd/PrOhJ/cP/0XzQQUO1+BUEiVtCwp2a52V aLru4CLbijCK1tYnxkodiYg7CzjJBnQD+qPMGe3HXXPKISBnLOc4EvgLrRjUfSkR 4k4eNrLL0jxmwkU9iQ5sAuyg0260mxaxpJw3yAQHZGF0n+feMs7sMwBgfpkw5V2z 4LsNg8c8/1DAQPrPKDElsm394FPd1/s97si0dUh9HHTInbX13ijGh1QvrkvVqGbA ZZ9P+zO9oertEISIlT+zhXRc1WXv8F29kdJMv/fu7tBcEw7TCg1zOAdo8+OVG558 mMqIJKhiWNygEuzNmoENVF4W6WuPWGB3Mhi0C0tVWaENxkF7mBmFiwhwxO4RFcFY ze/N8Pu0hnoC0/ZdqRasuJqFNXcI9nJ3S+GyaifgEpWV+vtk4GeNgSwFcwJeoyzR cY/9ct1NV7lvH5hM5wpPxQczk4IrK/w07jLtSB6eRB0zRB8MGAnZ4Xcg56Ob+YbO QsFn8T3ImIZU/bYhGy7Y8jVOL90KdfBikwNKM1PfTsDGQZhZDCwQOXF/u0BKc7HF 94O53ai/YHvpU+E+YuULfMtFZ0FTdWAwd3tqwH/neUztLiOhxPG+0Qv41jmdTTBk kk3373xYlqT3mkkRGtcEOANUphiVsRBzxB5IhovF8ihsvclfiNjTqoLOGYA4KwLd LL71ewV+Vk4p4ukQ1FcQ =bDVL -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY--