diff options
Diffstat (limited to 'arch/sandbox/board/hostfile.c')
-rw-r--r-- | arch/sandbox/board/hostfile.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c index 96fa100011..2cc7c1fbde 100644 --- a/arch/sandbox/board/hostfile.c +++ b/arch/sandbox/board/hostfile.c @@ -15,9 +15,6 @@ * 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 */ #include <common.h> @@ -102,7 +99,22 @@ device_initcall(hf_init); int barebox_register_filedev(struct hf_platform_data *hf) { - return !add_generic_device("hostfile", DEVICE_ID_DYNAMIC, NULL, hf->base, hf->size, - IORESOURCE_MEM, hf); + struct device_d *dev; + struct resource *res; + + dev = xzalloc(sizeof(*dev)); + strcpy(dev->name, "hostfile"); + dev->id = DEVICE_ID_DYNAMIC; + dev->platform_data = hf; + + res = xzalloc(sizeof(struct resource)); + res[0].start = hf->base; + res[0].end = hf->base + hf->size - 1; + res[0].flags = IORESOURCE_MEM; + + dev->resource = res; + dev->num_resources = 1; + + return sandbox_add_device(dev); } |