summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Borleis <jbe@pengutronix.de>2016-12-09 10:49:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-19 15:15:03 +0100
commit8bb4fcd5d98ad065436aa62544a0addaffd29475 (patch)
treeeeb10041998e8c7cf654b7b1f28bcc766f0ccfba
parenta16cab1f4afe0d3d7cc2bc598fd98961c0252573 (diff)
downloadbarebox-8bb4fcd5d98ad065436aa62544a0addaffd29475.tar.gz
imx-usb-loader: let constant data be const
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
-rw-r--r--scripts/imx/imx-usb-loader.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index be0894f..dfeef9e 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -72,11 +72,11 @@ struct usb_work {
};
struct usb_id {
- struct mach_id *mach_id;
+ const struct mach_id *mach_id;
struct usb_work *work;
};
-struct mach_id imx_ids[] = {
+const struct mach_id imx_ids[] = {
{
.vid = 0x066f,
.pid = 0x3780,
@@ -174,12 +174,12 @@ struct sdp_command {
uint8_t rsvd;
} __attribute__((packed));
-static struct mach_id *imx_device(unsigned short vid, unsigned short pid)
+static const struct mach_id *imx_device(unsigned short vid, unsigned short pid)
{
int i;
for (i = 0; i < ARRAY_SIZE(imx_ids); i++) {
- struct mach_id *id = &imx_ids[i];
+ const struct mach_id *id = &imx_ids[i];
if (id->vid == vid && id->pid == pid) {
fprintf(stderr, "found %s USB device [%04x:%04x]\n",
id->name, vid, pid);
@@ -190,10 +190,10 @@ static struct mach_id *imx_device(unsigned short vid, unsigned short pid)
return NULL;
}
-static libusb_device *find_imx_dev(libusb_device **devs, struct mach_id **pp_id)
+static libusb_device *find_imx_dev(libusb_device **devs, const struct mach_id **pp_id)
{
int i = 0;
- struct mach_id *p;
+ const struct mach_id *p;
for (;;) {
struct libusb_device_descriptor desc;
@@ -1288,7 +1288,7 @@ static void usage(const char *prgname)
int main(int argc, char *argv[])
{
- struct mach_id *mach;
+ const struct mach_id *mach;
libusb_device **devs;
libusb_device *dev;
int r;