Re: [PATCH v5 106/111] staging: greybus: pwm: Make use of devm_pwmchip_alloc() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Alex,

On Fri, Jan 26, 2024 at 09:08:15AM -0600, Alex Elder wrote:
> On 1/25/24 6:10 AM, Uwe Kleine-König wrote:
> > +	chip = devm_pwmchip_alloc(&gbphy_dev->dev, response.count, sizeof(*pwmc));
> > +	if (IS_ERR(chip)) {
> > +		ret = PTR_ERR(chip);
> > +		goto exit_connection_destroy;
> >   	}
> > +	pwmc = pwm_chip_to_gb_pwm_chip(chip);
> >   	pwmc->connection = connection;
> > +
> >   	gb_connection_set_data(connection, pwmc);
> > -	gb_gbphy_set_data(gbphy_dev, pwmc);
> > +	gb_gbphy_set_data(gbphy_dev, chip);
> 
> I'm pretty sure driver data should still be the Greybus
> structure, otherwise you're really changing the way this
> works (most likely in a way that's different from other
> Greybus drivers.

The problem is that you cannot easily get the chip from pwmc unless you
add a pointer to struct gb_pwm_chip.

Regarding your other feedback: You're right, this patch is more
intrusive than it should be. I wonder what went wrong. I'll do some
research and rework accordingly. Probably I squashed some things
together that should be separate patches.

thanks for your feedback
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux