lkml.org 
[lkml]   [2024]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v6 17/17] net: pse-pd: Add TI TPS23881 PSE controller driver
On Thu, 28 Mar 2024 17:17:43 +0100
Andrew Lunn <andrew@lunn.ch> wrote:

> > +
> > + /* Set operating mode */
> > + ret = i2c_smbus_write_word_data(client, TPS23881_REG_OP_MODE,
> > 0xaaaa);
>
> Could you add some #defines here? This is semiauto i think?

Yes

> > + /* Enable detection and classification */
> > + val = 0;
> > + for (i = 0; i < TPS23881_MAX_CHANS; i++) {
> > + if (!port_matrix[i].exist)
> > + continue;
> > +
> > + val |= BIT(port_matrix[i].lgcl_chan[0]) |
> > + BIT(port_matrix[i].lgcl_chan[0] + 4);
> > + if (port_matrix[i].is_4p)
> > + val |= BIT(port_matrix[i].lgcl_chan[1]) |
> > + BIT(port_matrix[i].lgcl_chan[1] + 4);
> > + }
> > + ret = i2c_smbus_write_word_data(client, TPS23881_REG_DET_CLA_EN,
> > 0xffff);
>
> This looks odd. You calculate val, and then don't use it?

Oh indeed, you are right! Thanks for spotting the issue.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2024-03-29 16:16    [W:1.227 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site