Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103145
b: refs/heads/master
c: 99c632e
h: refs/heads/master
i:
  103143: 13dfa40
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and John W. Linville committed Jun 26, 2008
1 parent 567c5a9 commit 87206d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79399a8d1908f6a406e82d23c5a9937e1722ed3a
refs/heads/master: 99c632e5a304e1f76350eb9e8b2493514de8b60c
33 changes: 15 additions & 18 deletions trunk/net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,34 +224,31 @@ static ssize_t rfkill_name_show(struct device *dev,
return sprintf(buf, "%s\n", rfkill->name);
}

static ssize_t rfkill_type_show(struct device *dev,
struct device_attribute *attr,
char *buf)
static const char *rfkill_get_type_str(enum rfkill_type type)
{
struct rfkill *rfkill = to_rfkill(dev);
const char *type;

switch (rfkill->type) {
switch (type) {
case RFKILL_TYPE_WLAN:
type = "wlan";
break;
return "wlan";
case RFKILL_TYPE_BLUETOOTH:
type = "bluetooth";
break;
return "bluetooth";
case RFKILL_TYPE_UWB:
type = "ultrawideband";
break;
return "ultrawideband";
case RFKILL_TYPE_WIMAX:
type = "wimax";
break;
return "wimax";
case RFKILL_TYPE_WWAN:
type = "wwan";
break;
return "wwan";
default:
BUG();
}
}

static ssize_t rfkill_type_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct rfkill *rfkill = to_rfkill(dev);

return sprintf(buf, "%s\n", type);
return sprintf(buf, "%s\n", rfkill_get_type_str(rfkill->type));
}

static ssize_t rfkill_state_show(struct device *dev,
Expand Down

0 comments on commit 87206d5

Please sign in to comment.