Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c21813e9 authored by Ezequiel García's avatar Ezequiel García Committed by Mauro Carvalho Chehab
Browse files

[media] cx25821: Replace struct memcpy with struct assignment



Copying structs by assignment is type safe.
Plus, is shorter and easier to read.

Signed-off-by: default avatarEzequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 23ba641a
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -305,11 +305,8 @@ int cx25821_i2c_register(struct cx25821_i2c *bus)

	dprintk(1, "%s(bus = %d)\n", __func__, bus->nr);

	memcpy(&bus->i2c_adap, &cx25821_i2c_adap_template,
	       sizeof(bus->i2c_adap));
	memcpy(&bus->i2c_client, &cx25821_i2c_client_template,
	       sizeof(bus->i2c_client));

	bus->i2c_adap = cx25821_i2c_adap_template;
	bus->i2c_client = cx25821_i2c_client_template;
	bus->i2c_adap.dev.parent = &dev->pci->dev;

	strlcpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name));