Message ID | 20221130152148.2769768-1-u.kleine-koenig@pengutronix.de |
---|---|
Headers | show |
Series | pwm: Allow .get_state to fail | expand |
Hello Andy, On Fri, Dec 09, 2022 at 11:47:54PM +0200, Andy Shevchenko wrote: > On Wed, Nov 30, 2022 at 04:21:37PM +0100, Uwe Kleine-König wrote: > > In v1 Thierry had the concern: > > > > | That raises the question about what to do in these cases. If we return > > | an error, that could potentially throw off consumers. So perhaps the > > | closest would be to return a disabled PWM? Or perhaps it'd be up to the > > | consumer to provide some fallback configuration for invalidly configured > > | or unconfigured PWMs. > > > > .get_state() is only called in pwm_device_request on a pwm_state that a > > consumer might see. Before my series a consumer might have seen a > > partial modified pwm_state (because .get_state() might have modified > > .period, then stumbled and returned silently). The last patch ensures > > that this partial modification isn't given out to the consumer. Instead > > they now see the same as if .get_state wasn't implemented at all. > > I'm wondering why we didn't see a compiler warning about mistyped function > prototypes in some drivers. I don't understand where you expected a warning. Care to elaborate? > P.S. The series is good thing to do, thank you. It's already too late for an ack, the series is already in Thierry's tree. Best regards Uwe
Hello Andy, On Sat, Dec 10, 2022 at 10:57:16PM +0200, Andy Shevchenko wrote: > On Sat, Dec 10, 2022 at 10:18:33AM +0100, Uwe Kleine-König wrote: > > On Fri, Dec 09, 2022 at 11:47:54PM +0200, Andy Shevchenko wrote: > > > On Wed, Nov 30, 2022 at 04:21:37PM +0100, Uwe Kleine-König wrote: > > ... > > > > I'm wondering why we didn't see a compiler warning about mistyped function > > > prototypes in some drivers. > > > > I don't understand where you expected a warning. Care to elaborate? > > intel-lpss.c has the prototype that returns an int. IIRC it was like this Do you mean drivers/mfd/intel-lpss.c? That one doesn't implement a PWM?! And drivers/pwm/pwm-lpss.c is adapted by this series. One of us is confused ... Best regards Uwe