OSDN Git Service

media: i2c: adv748x: Use devm to allocate the device struct
authorSteve Longerbeam <steve_longerbeam@mentor.com>
Fri, 11 Jan 2019 16:17:03 +0000 (14:17 -0200)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 21 Jan 2019 17:44:23 +0000 (15:44 -0200)
commitfb517583b3fe0bb6e64b8a861bfae5dc39f1cedb
tree2d055f4e12b80e50c611b7d0c06804ec4db4c6b7
parentcf20ae1535eb690a87c29b9cc7af51881384e967
media: i2c: adv748x: Use devm to allocate the device struct

Switch to devm_kzalloc() when allocating the adv748x device struct.

The sizeof() is updated to determine the correct allocation size from
the dereferenced pointer type rather than hardcoding the struct type.

[Kieran: Change sizeof() to dereference the pointer type]

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/adv748x/adv748x-core.c