Patchwork [02/24] petitboot: Revert const device in discover_client_ops

login
register
mail settings
Submitter Geoff Levand
Date April 13, 2009, 1:11 a.m.
Message ID <20090413011136.646007801@am.sony.com>
Download mbox | patch
Permalink /patch/25871/
State Accepted
Headers show

Comments

Geoff Levand - April 13, 2009, 1:11 a.m.
Make the device structure passed to the discover_client_ops callbacks
writable.

Commit 2b42cdd35ccd83c52e9df257efdfcda040d170d9 (Make client ops constant)
changed the discover_client_ops callback routine arguments to be pointers
to const device structures.  Typically, the callback routines will
initialize and destroy the device.ui_info and boot_option.info variables,
so the device instance must be writable by the callback routines.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 ui/common/discover-client.h |    4 ++--
 ui/test/pb-test.c           |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Patch

--- a/ui/common/discover-client.h
+++ b/ui/common/discover-client.h
@@ -13,8 +13,8 @@  struct discover_client;
  */
 
 struct discover_client_ops {
-	int (*device_add)(const struct device *device, void *arg);
-	void (*device_remove)(const struct device *device, void *arg);
+	int (*device_add)(struct device *device, void *arg);
+	void (*device_remove)(struct device *device, void *arg);
 	void *cb_arg;
 };
 
--- a/ui/test/pb-test.c
+++ b/ui/test/pb-test.c
@@ -3,7 +3,7 @@ 
 
 #include "ui/common/discover-client.h"
 
-static int print_device_add(const struct device *device,
+static int print_device_add(struct device *device,
 	void __attribute__((unused)) *arg)
 {
 	struct boot_option *opt;
@@ -28,7 +28,7 @@  static int print_device_add(const struct
 	return 0;
 }
 
-static void print_device_remove(const struct device *device,
+static void print_device_remove(struct device *device,
 	void __attribute__((unused)) *arg)
 {
 	printf("removed device:\n");