diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_nand.c | 16 | ||||
-rw-r--r-- | common/usb_storage.c | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 60cdd8eb497..0e49e9f08da 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -38,7 +38,7 @@ struct nand_oob_config { int eccvalid_pos; /* position of ECC valid flag inside oob -1 = inactive */ } oob_config = { {0}, 0, 0}; -#define NAND_DEBUG +#undef NAND_DEBUG #undef PSYCHO_DEBUG /* ****************** WARNING ********************* @@ -734,7 +734,9 @@ static void NanD_ScanChips(struct nand_chip *nand) /* If there are none at all that we recognise, bail */ if (!nand->numchips) { +#ifdef NAND_DEBUG puts ("No NAND flash chips recognised.\n"); +#endif return; } @@ -1408,7 +1410,7 @@ static inline int nandcheck(unsigned long potential, unsigned long physadr) return 0; } -void nand_probe(unsigned long physadr) +unsigned long nand_probe(unsigned long physadr) { struct nand_chip *nand = NULL; int i = 0, ChipID = 1; @@ -1434,10 +1436,12 @@ void nand_probe(unsigned long physadr) for (i=0; i<CFG_MAX_NAND_DEVICE; i++) { if (nand_dev_desc[i].ChipID == NAND_ChipID_UNKNOWN) { - nand = nand_dev_desc + i; + nand = &nand_dev_desc[i]; break; } } + if (!nand) + return (0); memset((char *)nand, 0, sizeof(struct nand_chip)); @@ -1449,7 +1453,7 @@ void nand_probe(unsigned long physadr) /* no chips found, clean up and quit */ memset((char *)nand, 0, sizeof(struct nand_chip)); nand->ChipID = NAND_ChipID_UNKNOWN; - return; + return (0); } nand->ChipID = ChipID; @@ -1459,8 +1463,10 @@ void nand_probe(unsigned long physadr) nand->data_buf = malloc (nand->oobblock + nand->oobsize); if (!nand->data_buf) { puts ("Cannot allocate memory for data structures.\n"); - return; + return (0); } + + return (nand->totlen); } #ifdef CONFIG_MTD_NAND_ECC diff --git a/common/usb_storage.c b/common/usb_storage.c index 70890361bb0..f95a1d39beb 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -613,7 +613,7 @@ int usb_stor_BBB_transport(ccb *srb, struct us_data *us) result = usb_bulk_msg(us->pusb_dev, pipe, srb->pdata, srb->datalen, &data_actlen, USB_CNTL_TIMEOUT*5); /* special handling of STALL in DATA phase */ if((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) { - printf("DATA:stall\n"); + USB_STOR_PRINTF("DATA:stall\n"); /* clear the STALL on the endpoint */ result = usb_stor_BBB_clear_endpt_stall(us, dir_in? us->ep_in : us->ep_out); if (result >= 0) @@ -1081,8 +1081,8 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,struct us_data ss->irqpipe = usb_rcvintpipe(ss->pusb_dev, ss->ep_int); ss->irqmaxp = usb_maxpacket(dev, ss->irqpipe); dev->irq_handle=usb_stor_irq; - dev->privptr=(void *)ss; } + dev->privptr=(void *)ss; return 1; } |