Re: [PATCH v2] Add basic support for password protected (locked) SD cards.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ulf,

On 04.07.2013, at 09:21, Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote:
> Hi Peter,
> 
> You need a mmc_get|put_card surrounding the call for re-intitalize the card.
Sorry, but I can not find no mmc_get_card function in the current kernel mmc git repository.
These could be found in mmc/card/block.c:
static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk);
static struct mmc_blk_data *mmc_blk_put(struct gendisk *disk);
I used the above, like e.g. the mmc_blk_ioctl_cmd() function which my routine is based upon, like so:
>> +       if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains))
>> +               return -EPERM;
>> +
>> +       md = mmc_blk_get(bdev->bd_disk);
>> +       if (!md) {
>> +               err = -EINVAL;
>> +               goto cmd_err;
>> +       }


Furthermore there are the following get|put functions defined:
drivers/mmc/core/core.c:
static inline void mmc_bus_get(struct mmc_host *host);
static inline void mmc_bus_put(struct mmc_host *host);

Or maybe I did not see it. Which ones did you mean and should I use?
> 
> Kind regards
> Ulf Hansson

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




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux