Re: [ANN] asic3_mmc machine-specific write protect lock handling

From: pHilipp Zabel <philipp.zabel_at_gmail.com>
Date: Fri, 22 Dec 2006 07:28:22 +0100

Hi Paul!

On 12/22/06, Paul Sokolovsky <pmiscml_at_gmail.com> wrote:
> Hello kernel-discuss,
>
> Following the discussion of WP lock handling some devices have,
> http://handhelds.org/hypermail/kernel-discuss/19/1929.html , I've
> implemented a way to configure such handling on per-machine basis. Two
> most common cases: use native ASIC3 handling and card w/o WP lock,
> don't require writing any specific code. See commit message below for
> details.
>
> To override default setting (use ASIC3 stuff), you'll need to
> provide structure like:
>
> static struct tmio_mmc_hwconfig h3900_mmc_hwconfig = {
> .mmc_get_ro = (void*)-1,
> };
>
> and pass it via ASIC3's platform_data's .tmio_mmc_hwconfig field. See
> h3900.c for example.
>
>
> I've tested these refactors to not produce obvious regressions,
> and that (void*)-1 value works as expected.

Wouldn't it be cleaner to have a tmio_mmc_get_ro_stub() or similar
function that always returns 1? I don't know if it is acceptable to have
a function pointer that is not quite a pointer.
Otherwise I'd provide a macro definition for that (void *)-1.
It is not very descriptive.

cheers
Philipp
Received on Fri Dec 22 2006 - 01:28:28 EST

This archive was generated by hypermail 2.2.0 : Fri Dec 22 2006 - 01:28:44 EST