lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 02 Jul 2014 10:52:02 +0800
From:	Aaron Lu <aaron.lu@...el.com>
To:	"Fu, Zhonghui" <zhonghui.fu@...ux.intel.com>, chris@...ntf.net,
	ulf.hansson@...aro.org, jh80.chung@...sung.com,
	tgih.jun@...sung.com, linux-mmc@...r.kernel.org,
	linux-kernel@...r.kernel.org, jackey.shen@....com,
	gregkh@...uxfoundation.org
Subject: Re: one doubt about mmc_sdio_init_card function

On 07/01/2014 01:39 PM, Fu, Zhonghui wrote:
> 
> Hi, all
> 
> The mmc_sdio_init_card(drivers/mmc/core/sdio.c) function calls mmc_alloc_card(drivers/mmc/core/bus.c) function to allocate a card structure. card->dev.bus is assigned with mmc_bus_type in mmc_alloc_card function. Why not assign sdio_bus_type to card->dev.bus?

sdio card, mmc card, sd card are all devices on the mmc bus, hence their
bus type is set to mmc_bus_type.

sdio function device is a device on the sdio bus, hence its bus type is
sdio_bus_type.

Hope this helps,
Aaron

> 
> 
> struct mmc_card *mmc_alloc_card(struct mmc_host *host, struct device_type *type)
> {
>     struct mmc_card *card;
> 
>     card = kzalloc(sizeof(struct mmc_card), GFP_KERNEL);
>     if (!card)
>         return ERR_PTR(-ENOMEM);
> 
>     card->host = host;
> 
>     device_initialize(&card->dev);
> 
>     card->dev.parent = mmc_classdev(host);
>     card->dev.bus = &mmc_bus_type;
>     card->dev.release = mmc_release_card;
>     card->dev.type = type;
> 
>     return card;
> }
> 
> 
> Thanks,
> Zhonghui
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ