Author: marius Date: Thu Aug 23 20:25:27 2018 New Revision: 338275 URL: https://svnweb.freebsd.org/changeset/base/338275
Log: Obtain the bus mode (MMC or SD) from the directly superordinated bus rather than reaching up to the bridge and use the cached mode in mmcsd_delete(), too. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Thu Aug 23 19:58:24 2018 (r338274) +++ head/sys/dev/mmc/mmcsd.c Thu Aug 23 20:25:27 2018 (r338275) @@ -247,7 +247,7 @@ mmcsd_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; sc->mmcbus = mmcbus = device_get_parent(dev); - sc->mode = mmcbr_get_mode(mmcbus); + sc->mode = mmc_get_card_type(dev); /* * Note that in principle with an SDHCI-like re-tuning implementation, * the maximum data size can change at runtime due to a device removal/ @@ -1315,7 +1315,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) memset(&cmd, 0, sizeof(cmd)); cmd.mrq = &req; req.cmd = &cmd; - if (mmc_get_card_type(dev) == mode_sd) + if (sc->mode == mode_sd) cmd.opcode = SD_ERASE_WR_BLK_START; else cmd.opcode = MMC_ERASE_GROUP_START; @@ -1334,7 +1334,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) memset(&req, 0, sizeof(req)); memset(&cmd, 0, sizeof(cmd)); req.cmd = &cmd; - if (mmc_get_card_type(dev) == mode_sd) + if (sc->mode == mode_sd) cmd.opcode = SD_ERASE_WR_BLK_END; else cmd.opcode = MMC_ERASE_GROUP_END; _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"