Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: ov7670: Drop CONFIG_OF ifdeffery

Drop of_match_ptr() from ov7670_driver and get rid of ugly CONFIG_OF
if check. This slightly increases the size of ov7670_driver on non-OF
system and shouldn't be an issue.

Add mod_devicetable.h include.

It also allows, in case if needed, to enumerate this device via ACPI with
PRP0001 magic.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Biju Das and committed by
Hans Verkuil
2d13621c dd2dbf3c

+2 -3
+2 -3
drivers/media/i2c/ov7670.c
··· 10 10 */ 11 11 #include <linux/clk.h> 12 12 #include <linux/init.h> 13 + #include <linux/mod_devicetable.h> 13 14 #include <linux/module.h> 14 15 #include <linux/slab.h> 15 16 #include <linux/i2c.h> ··· 1994 1993 }; 1995 1994 MODULE_DEVICE_TABLE(i2c, ov7670_id); 1996 1995 1997 - #if IS_ENABLED(CONFIG_OF) 1998 1996 static const struct of_device_id ov7670_of_match[] = { 1999 1997 { .compatible = "ovti,ov7670", &ov7670_devdata }, 2000 1998 { /* sentinel */ } 2001 1999 }; 2002 2000 MODULE_DEVICE_TABLE(of, ov7670_of_match); 2003 - #endif 2004 2001 2005 2002 static struct i2c_driver ov7670_driver = { 2006 2003 .driver = { 2007 2004 .name = "ov7670", 2008 - .of_match_table = of_match_ptr(ov7670_of_match), 2005 + .of_match_table = ov7670_of_match, 2009 2006 }, 2010 2007 .probe = ov7670_probe, 2011 2008 .remove = ov7670_remove,