Deleted Added
full compact
mmc.c (183467) mmc.c (183468)
1/*-
2 * Copyright (c) 2006 Bernd Walter. All rights reserved.
3 * Copyright (c) 2006 M. Warner Losh. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 37 unchanged lines hidden (view full) ---

46 * implication, estoppel or otherwise under any patent or other rights of the
47 * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
48 * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
49 * or the SD Card Association to disclose or distribute any technical
50 * information, know-how or other confidential information to any third party.
51 */
52
53#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Bernd Walter. All rights reserved.
3 * Copyright (c) 2006 M. Warner Losh. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 37 unchanged lines hidden (view full) ---

46 * implication, estoppel or otherwise under any patent or other rights of the
47 * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
48 * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
49 * or the SD Card Association to disclose or distribute any technical
50 * information, know-how or other confidential information to any third party.
51 */
52
53#include <sys/cdefs.h>
54__FBSDID("$FreeBSD: head/sys/dev/mmc/mmc.c 183467 2008-09-29 18:05:26Z imp $");
54__FBSDID("$FreeBSD: head/sys/dev/mmc/mmc.c 183468 2008-09-29 18:17:23Z imp $");
55
56#include <sys/param.h>
57#include <sys/systm.h>
58#include <sys/kernel.h>
59#include <sys/malloc.h>
60#include <sys/lock.h>
61#include <sys/module.h>
62#include <sys/mutex.h>

--- 550 unchanged lines hidden (view full) ---

613mmc_discover_cards(struct mmc_softc *sc)
614{
615 struct mmc_ivars *ivar;
616 int err;
617 uint32_t resp;
618 device_t child;
619
620 while (1) {
55
56#include <sys/param.h>
57#include <sys/systm.h>
58#include <sys/kernel.h>
59#include <sys/malloc.h>
60#include <sys/lock.h>
61#include <sys/module.h>
62#include <sys/mutex.h>

--- 550 unchanged lines hidden (view full) ---

613mmc_discover_cards(struct mmc_softc *sc)
614{
615 struct mmc_ivars *ivar;
616 int err;
617 uint32_t resp;
618 device_t child;
619
620 while (1) {
621 ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF, M_WAITOK);
621 ivar = malloc(sizeof(struct mmc_ivars), M_DEVBUF,
622 M_WAITOK | M_ZERO);
622 if (!ivar)
623 return;
624 err = mmc_all_send_cid(sc, ivar->raw_cid);
625 if (err == MMC_ERR_TIMEOUT)
626 break;
627 if (err != MMC_ERR_NONE) {
623 if (!ivar)
624 return;
625 err = mmc_all_send_cid(sc, ivar->raw_cid);
626 if (err == MMC_ERR_TIMEOUT)
627 break;
628 if (err != MMC_ERR_NONE) {
628 printf("Error reading CID %d\n", err);
629 device_printf(sc->dev, "Error reading CID %d\n", err);
629 break;
630 }
631 if (mmcbr_get_mode(sc->dev) == mode_sd) {
632 ivar->mode = mode_sd;
633 mmc_decode_cid(1, ivar->raw_cid, &ivar->cid);
634 mmc_send_relative_addr(sc, &resp);
635 ivar->rca = resp >> 16;
636 if (mmcbr_get_ro(sc->dev))

--- 183 unchanged lines hidden ---
630 break;
631 }
632 if (mmcbr_get_mode(sc->dev) == mode_sd) {
633 ivar->mode = mode_sd;
634 mmc_decode_cid(1, ivar->raw_cid, &ivar->cid);
635 mmc_send_relative_addr(sc, &resp);
636 ivar->rca = resp >> 16;
637 if (mmcbr_get_ro(sc->dev))

--- 183 unchanged lines hidden ---