2 * MTD utility functions
4 * Copyright (C) 2009, Broadcom Corporation. All Rights Reserved.
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * $Id: mtd.h,v 1.8 2009/12/02 20:02:50 Exp $
26 * @param mtd path to or partition name of MTD device
27 * @param flags open() flags
28 * @return return value of open()
30 extern int mtd_open(const char *mtd
, int flags
);
34 * @param mtd path to or partition name of MTD device
35 * @return 0 on success and errno on failure
37 extern int mtd_erase(const char *mtd
);
40 * Write a file or a URL to an MTD device
41 * @param path file to write or a URL
42 * @param mtd path to or partition name of MTD device
43 * @return 0 on success and errno on failure
45 extern int mtd_write(const char *path
, const char *mtd
);