Re: [PATCH v2 1/3] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver

From: Guenter Roeck
Date: Wed May 28 2014 - 09:28:15 EST


On 05/28/2014 12:02 AM, Johannes Thumshirn wrote:
[ ... ]

+
+static int menf21bmc_write_byte(struct i2c_client *client, u8 val)
+{
+ int ret;
+ struct menf21bmc *data = i2c_get_clientdata(client);
+
+ mutex_lock(&data->lock);
+ ret = i2c_smbus_write_byte(client, val);
+ mutex_unlock(&data->lock);
+
+ return ret;
+}

Didn't we ask you to remove these? Just make the i2c_smbus_* calls
from within the driver. The I2C subsystem conducts its own locking.
I'm really starting to frown on aggregation for the sake of
aggregation. It's just overhead.


Correct me if I'm wrong but as far as I remember Guenther asked to retain the
original API, not the remove the "abstraction layer". Once we build a board with
one of these BMCs attached via e.g. SPI we would have to reintroduce it anyways,
in order to re-use these drivers.


If you introduce boards with SPI support, you'll likely have to change those APIs,
since some of the functions don't make sense in the SPI world. So I tend to agree
with Lee. If you need those APIs later on you can introduce them at that time,
and introduce them such that they truly work for all hardware variants.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/