OSDN Git Service

media: ngene: check for CXD2099AR presence before attaching
authorDaniel Scheller <d.scheller@gmx.net>
Sun, 25 Feb 2018 12:31:37 +0000 (07:31 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 6 Mar 2018 16:15:01 +0000 (11:15 -0500)
commite39b8e945eb749d3bef21b38309f84de8f7a3007
treeacb371ae4e8b557737c15a5ea008b79c78387c41
parentee93340e98bc9026dedf6e7483f9f092d1765582
media: ngene: check for CXD2099AR presence before attaching

Currently, if there's no CXD2099AR attached to any expansion connector of
the ngene hardware, it will complain with this on every module load:

    cxd2099 1-0040: No CXD2099AR detected at 0x40
    cxd2099: probe of 1-0040 failed with error -5
    ngene 0000:02:00.0: CXD2099AR attach failed

This happens due to the logic assuming such hardware is always there and
blindly tries to attach the cxd2099 I2C driver. Rather add a probe
function (in ngene-cards.c with a prototype in ngene.h) to check for
the existence of such hardware before probing, and don't try further if
no CXD2099 was found.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/ngene/ngene-cards.c
drivers/media/pci/ngene/ngene-core.c
drivers/media/pci/ngene/ngene.h