From: Heiner Kallweit Date: Mon, 19 Dec 2022 18:15:25 +0000 (+0100) Subject: i2c: i801: make FEATURE_BLOCK_PROC dependent on FEATURE_BLOCK_BUFFER X-Git-Tag: v6.6.17~5446^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e98a3bc0403bc60e949b565f3b36c6aed399a976;p=platform%2Fkernel%2Flinux-rpi.git i2c: i801: make FEATURE_BLOCK_PROC dependent on FEATURE_BLOCK_BUFFER According to the datasheet the block process call requires block buffer mode. The user may disable block buffer mode by module parameter disable_features, in such a case we have to clear FEATURE_BLOCK_PROC. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 45c2ebe..2e9c585 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1658,6 +1658,10 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) } priv->features &= ~disable_features; + /* The block process call uses block buffer mode */ + if (!(priv->features & FEATURE_BLOCK_BUFFER)) + priv->features &= ~FEATURE_BLOCK_PROC; + err = pcim_enable_device(dev); if (err) { dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n",