]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/spi/mpc8xxx_spi.c
Update from 2013.01 to 2013.07
[karo-tx-uboot.git] / drivers / spi / mpc8xxx_spi.c
index 4e46041dfff5df76c98561d161daa4a13790acd5..bbfc259e47382e8c690289bcb445deb0beaf6977 100644 (file)
@@ -2,23 +2,7 @@
  * Copyright (c) 2006 Ben Warren, Qstreams Networks Inc.
  * With help from the common/soft_spi and arch/powerpc/cpu/mpc8260 drivers
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -45,13 +29,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        if (!spi_cs_is_valid(bus, cs))
                return NULL;
 
-       slave = malloc(sizeof(struct spi_slave));
+       slave = spi_alloc_slave_base(bus, cs);
        if (!slave)
                return NULL;
 
-       slave->bus = bus;
-       slave->cs = cs;
-
        /*
         * TODO: Some of the code in spi_init() should probably move
         * here, or into spi_claim_bus() below.