Re: [PATCH 1/3] gpio: mockup: fix indicated direction

From: Uwe Kleine-König
Date: Tue Nov 13 2018 - 01:57:59 EST


Hello Bartosz,

On Mon, Nov 12, 2018 at 03:14:31PM +0100, Bartosz Golaszewski wrote:
> > > As I said before: it is and should be fixed in this specific case.
> > > This isn't real hardware.

Not being "real hardware" is hardly an argument that matters here.

> > Not sure if we agree here yet. What do you want to fix? The driver or
> > the test?
> >
> > In my eyes test driven development is great. But if something breaks
> > because the test is wrong, please don't "fix" the system to repair the
> > test, but modify the test to be able to handle reality.
> >
>
> No, we don't have an agreement. You think I should fix the test, I
> think the dummy driver should continue behaving like before.

It's arguable if after your patch the driver behaves as before. IMHO the
initial direction was output from the start before. This was just
shadowed by the an inconsitency that was fixed some time ago.

> Given that there's no real hardware behind, the direction of newly
> created dummy lines has always been deterministic - input. Certain
> tests have been relying on it. I want to keep on doing it. There's no
> harm. It's not broken logic as the very purpose of this module is to
> allow for easy testing of the UAPI.
>
> So unless something *else* is wrong with this patch, I intend to push
> it upstream.

Note I don't oppose to the patch as is. Just the motiviation is wrong
and I'd do both: Modify the mockup driver to start with direction=input
and modify the tests to not expect this.

Best regards
Uwe

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