[media] soc-camera: split struct soc_camera_link into host and subdevice parts
struct soc_camera_link currently contains fields, used both by sensor and bridge drivers. To make subdevice driver re-use simpler, split it into a host and a subdevice parts. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
dd669e907c
commit
25a3481100
@@ -38,10 +38,12 @@ static inline int soc_camera_platform_add(struct soc_camera_device *icd,
|
||||
void (*release)(struct device *dev),
|
||||
int id)
|
||||
{
|
||||
struct soc_camera_platform_info *info = plink->priv;
|
||||
struct soc_camera_subdev_desc *ssdd =
|
||||
(struct soc_camera_subdev_desc *)plink;
|
||||
struct soc_camera_platform_info *info = ssdd->drv_priv;
|
||||
int ret;
|
||||
|
||||
if (icd->link != plink)
|
||||
if (&icd->sdesc->subdev_desc != ssdd)
|
||||
return -ENODEV;
|
||||
|
||||
if (*pdev)
|
||||
@@ -70,7 +72,9 @@ static inline void soc_camera_platform_del(const struct soc_camera_device *icd,
|
||||
struct platform_device *pdev,
|
||||
const struct soc_camera_link *plink)
|
||||
{
|
||||
if (icd->link != plink || !pdev)
|
||||
const struct soc_camera_subdev_desc *ssdd =
|
||||
(const struct soc_camera_subdev_desc *)plink;
|
||||
if (&icd->sdesc->subdev_desc != ssdd || !pdev)
|
||||
return;
|
||||
|
||||
platform_device_unregister(pdev);
|
||||
|
Reference in New Issue
Block a user