On 09/23/2010 10:48 AM, Wolfram Sang wrote:
> I think it will be better to give init() access to all information
> needed than to implement another hook. I tried with this patch
> 
> https://patchwork.kernel.org/patch/196992/
> 
> I am still not sure what kind of information you need from the pdev. Can
> you create a branch somewhere with your current work?


Hi Wolfram,
I've just sent some patches and I used the .init as you wanted.

Fortunately the problem can be resolved without modifying .init within
the sdhci_pltfm_data structure.

The sdhci_host structure has the mmc field that also has the pointer to
the device parent.
This can be used for getting the device structure pointer in my platform.
For example, below there is the piece of code added, in my platform, to
use the sdhci-pltfm driver.

It works fine without modifying other files.

What do you think?

Regards,
Peppe

[snip]

static int mmc_pad_resources(struct sdhci_host *sdhci)
{
        if (!devm_stm_pad_claim(sdhci->mmc->parent,
                                &stx7108_mmc_pad_config,
                                dev_name(sdhci->mmc->parent)))
                return -ENODEV;

        return 0;
}

static struct sdhci_pltfm_data stx7108_mmc_platform_data = {
                .init = &mmc_pad_resources,
                .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
};

static struct platform_device stx7108_mmc_device = {
                .name = "sdhci",

[snip]

> 
> Regards,
> 
>    Wolfram
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to