On Thu, Apr 7, 2022 at 10:42 PM Eddie James <eajames@xxxxxxxxxxxxx> wrote:
Clean up the I2C access functions to avoid fetching the pca955xSeparate patch.
driver data again. Optimize the probe to do at most 4 reads and
4 writes of the LED selector regs, rather than 16 of each.
Rename some functions and variables to be more consistent and
descriptive.
+ dev_err(&pca955x->client->dev,This can be indented better.
+ "%s: reg 0x%x, val 0x%x, err %d\n", __func__, n, val,
+ ret);
I would add a temporary dev pointer variable and put this on one line.
struct device *dev = &pca955x->client->dev;
dev_err(dev, "%s: reg 0x%x, val 0x%x, err %d\n",
__func__, n, val, ret);
...
+ dev_err(&pca955x->client->dev,Ditto.
+ "%s: reg 0x%x, val 0x%x, err %d\n", __func__, n, val,
+ ret);
...
+ dev_err(&pca955x->client->dev,Ditto.
+ "%s: reg 0x%x, val 0x%x, err %d\n", __func__, n, val,
+ ret);
...
+ dev_err(&pca955x->client->dev, "%s: reg 0x%x, err %d\n",Ditto.
__func__, n, ret);
...
+ dev_err(&pca955x->client->dev, "%s: reg 0x%x, err %d\n",Ditto.
__func__, n, ret);
...
+ struct pca955x_led *pca955x_led = container_of(led_cdev,Is it used once? If more than once, consider a helper for that as well.
+ struct pca955x_led,
+ led_cdev);