Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9e0ce90e
Commit
9e0ce90e
authored
Nov 12, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/gregkh/linux/driver-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
aa5743cc
c5f192ee
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
86 additions
and
44 deletions
+86
-44
arch/arm/common/locomo.c
arch/arm/common/locomo.c
+0
-3
arch/arm/common/sa1111.c
arch/arm/common/sa1111.c
+15
-8
arch/arm/mach-sa1100/neponset.c
arch/arm/mach-sa1100/neponset.c
+15
-8
drivers/base/bus.c
drivers/base/bus.c
+1
-1
drivers/base/class.c
drivers/base/class.c
+6
-0
drivers/base/core.c
drivers/base/core.c
+21
-0
drivers/block/genhd.c
drivers/block/genhd.c
+6
-0
drivers/video/aty/aty128fb.c
drivers/video/aty/aty128fb.c
+5
-5
drivers/video/aty/atyfb_base.c
drivers/video/aty/atyfb_base.c
+5
-5
drivers/video/aty/radeon_pm.c
drivers/video/aty/radeon_pm.c
+3
-3
fs/sysfs/dir.c
fs/sysfs/dir.c
+3
-3
include/linux/device.h
include/linux/device.h
+0
-5
include/linux/kobject_uevent.h
include/linux/kobject_uevent.h
+1
-0
lib/kobject_uevent.c
lib/kobject_uevent.c
+5
-3
No files found.
arch/arm/common/locomo.c
View file @
9e0ce90e
...
...
@@ -627,9 +627,6 @@ static int locomo_remove(struct device *dev)
if
(
lchip
)
{
__locomo_remove
(
lchip
);
dev_set_drvdata
(
dev
,
NULL
);
kfree
(
dev
->
saved_state
);
dev
->
saved_state
=
NULL
;
}
return
0
;
...
...
arch/arm/common/sa1111.c
View file @
9e0ce90e
...
...
@@ -797,6 +797,8 @@ struct sa1111_save_data {
unsigned
int
wakeen1
;
};
#ifdef CONFIG_PM
static
int
sa1111_suspend
(
struct
device
*
dev
,
u32
state
,
u32
level
)
{
struct
sa1111
*
sachip
=
dev_get_drvdata
(
dev
);
...
...
@@ -808,11 +810,10 @@ static int sa1111_suspend(struct device *dev, u32 state, u32 level)
if
(
level
!=
SUSPEND_DISABLE
)
return
0
;
dev
->
saved_stat
e
=
kmalloc
(
sizeof
(
struct
sa1111_save_data
),
GFP_KERNEL
);
if
(
!
dev
->
saved_stat
e
)
sav
e
=
kmalloc
(
sizeof
(
struct
sa1111_save_data
),
GFP_KERNEL
);
if
(
!
sav
e
)
return
-
ENOMEM
;
save
=
(
struct
sa1111_save_data
*
)
dev
->
saved_state
;
dev
->
power
.
saved_state
=
save
;
spin_lock_irqsave
(
&
sachip
->
lock
,
flags
);
...
...
@@ -870,7 +871,7 @@ static int sa1111_resume(struct device *dev, u32 level)
if
(
level
!=
RESUME_ENABLE
)
return
0
;
save
=
(
struct
sa1111_save_data
*
)
dev
->
saved_state
;
save
=
(
struct
sa1111_save_data
*
)
dev
->
power
.
saved_state
;
if
(
!
save
)
return
0
;
...
...
@@ -915,12 +916,18 @@ static int sa1111_resume(struct device *dev, u32 level)
spin_unlock_irqrestore
(
&
sachip
->
lock
,
flags
);
dev
->
saved_state
=
NULL
;
dev
->
power
.
saved_state
=
NULL
;
kfree
(
save
);
return
0
;
}
#else
/* !CONFIG_PM */
#define sa1111_resume NULL
#define sa1111_suspend NULL
#endif
/* !CONFIG_PM */
static
int
sa1111_probe
(
struct
device
*
dev
)
{
struct
platform_device
*
pdev
=
to_platform_device
(
dev
);
...
...
@@ -943,8 +950,8 @@ static int sa1111_remove(struct device *dev)
__sa1111_remove
(
sachip
);
dev_set_drvdata
(
dev
,
NULL
);
kfree
(
dev
->
saved_state
);
dev
->
saved_state
=
NULL
;
kfree
(
dev
->
power
.
saved_state
);
dev
->
power
.
saved_state
=
NULL
;
}
return
0
;
...
...
arch/arm/mach-sa1100/neponset.c
View file @
9e0ce90e
...
...
@@ -173,6 +173,8 @@ static int neponset_probe(struct device *dev)
return
0
;
}
#ifdef CONFIG_PM
/*
* LDM power management.
*/
...
...
@@ -184,12 +186,12 @@ static int neponset_suspend(struct device *dev, u32 state, u32 level)
if
(
level
==
SUSPEND_SAVE_STATE
||
level
==
SUSPEND_DISABLE
||
level
==
SUSPEND_POWER_DOWN
)
{
if
(
!
dev
->
saved_state
)
dev
->
saved_state
=
kmalloc
(
sizeof
(
unsigned
int
),
GFP_KERNEL
);
if
(
!
dev
->
saved_state
)
if
(
!
dev
->
power
.
saved_state
)
dev
->
power
.
saved_state
=
kmalloc
(
sizeof
(
unsigned
int
),
GFP_KERNEL
);
if
(
!
dev
->
power
.
saved_state
)
return
-
ENOMEM
;
*
(
unsigned
int
*
)
dev
->
saved_state
=
NCR_0
;
*
(
unsigned
int
*
)
dev
->
power
.
saved_state
=
NCR_0
;
}
return
0
;
...
...
@@ -198,16 +200,21 @@ static int neponset_suspend(struct device *dev, u32 state, u32 level)
static
int
neponset_resume
(
struct
device
*
dev
,
u32
level
)
{
if
(
level
==
RESUME_RESTORE_STATE
||
level
==
RESUME_ENABLE
)
{
if
(
dev
->
saved_state
)
{
NCR_0
=
*
(
unsigned
int
*
)
dev
->
saved_state
;
kfree
(
dev
->
saved_state
);
dev
->
saved_state
=
NULL
;
if
(
dev
->
power
.
saved_state
)
{
NCR_0
=
*
(
unsigned
int
*
)
dev
->
power
.
saved_state
;
kfree
(
dev
->
power
.
saved_state
);
dev
->
power
.
saved_state
=
NULL
;
}
}
return
0
;
}
#else
#define neponset_suspend NULL
#define neponset_resume NULL
#endif
static
struct
device_driver
neponset_device_driver
=
{
.
name
=
"neponset"
,
.
bus
=
&
platform_bus_type
,
...
...
drivers/base/bus.c
View file @
9e0ce90e
...
...
@@ -247,7 +247,7 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
* device_bind_driver - bind a driver to one device.
* @dev: device.
*
* Allow manual attachment of a driver to a de
iv
ce.
* Allow manual attachment of a driver to a de
vi
ce.
* Caller must have already set @dev->driver.
*
* Note that this does not modify the bus reference count
...
...
drivers/base/class.c
View file @
9e0ce90e
...
...
@@ -303,6 +303,12 @@ static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
buffer
,
buffer_size
,
&
length
,
"PHYSDEVBUS=%s"
,
dev
->
bus
->
name
);
/* add driver name of physical device */
if
(
dev
->
driver
)
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PHYSDEVDRIVER=%s"
,
dev
->
driver
->
name
);
/* terminate, set to next free slot, shrink available space */
envp
[
i
]
=
NULL
;
envp
=
&
envp
[
i
];
...
...
drivers/base/core.c
View file @
9e0ce90e
...
...
@@ -116,8 +116,29 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
int
num_envp
,
char
*
buffer
,
int
buffer_size
)
{
struct
device
*
dev
=
to_dev
(
kobj
);
int
i
=
0
;
int
length
=
0
;
int
retval
=
0
;
/* add bus name of physical device */
if
(
dev
->
bus
)
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PHYSDEVBUS=%s"
,
dev
->
bus
->
name
);
/* add driver name of physical device */
if
(
dev
->
driver
)
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PHYSDEVDRIVER=%s"
,
dev
->
driver
->
name
);
/* terminate, set to next free slot, shrink available space */
envp
[
i
]
=
NULL
;
envp
=
&
envp
[
i
];
num_envp
-=
i
;
buffer
=
&
buffer
[
length
];
buffer_size
-=
length
;
if
(
dev
->
bus
->
hotplug
)
{
/* have the bus specific function add its stuff */
retval
=
dev
->
bus
->
hotplug
(
dev
,
envp
,
num_envp
,
buffer
,
buffer_size
);
...
...
drivers/block/genhd.c
View file @
9e0ce90e
...
...
@@ -469,6 +469,12 @@ static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
buffer
,
buffer_size
,
&
length
,
"PHYSDEVBUS=%s"
,
dev
->
bus
->
name
);
/* add driver name of physical device */
if
(
dev
->
driver
)
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PHYSDEVDRIVER=%s"
,
dev
->
driver
->
name
);
envp
[
i
]
=
NULL
;
}
...
...
drivers/video/aty/aty128fb.c
View file @
9e0ce90e
...
...
@@ -2363,7 +2363,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, u32 state)
state
=
2
;
#endif
/* CONFIG_PPC_PMAC */
if
(
state
!=
2
||
state
==
pdev
->
dev
.
power_state
)
if
(
state
!=
2
||
state
==
pdev
->
dev
.
power
.
power
_state
)
return
0
;
printk
(
KERN_DEBUG
"aty128fb: suspending...
\n
"
);
...
...
@@ -2394,7 +2394,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, u32 state)
release_console_sem
();
pdev
->
dev
.
power_state
=
state
;
pdev
->
dev
.
power
.
power
_state
=
state
;
return
0
;
}
...
...
@@ -2404,13 +2404,13 @@ static int aty128_pci_resume(struct pci_dev *pdev)
struct
fb_info
*
info
=
pci_get_drvdata
(
pdev
);
struct
aty128fb_par
*
par
=
info
->
par
;
if
(
pdev
->
dev
.
power_state
==
0
)
if
(
pdev
->
dev
.
power
.
power
_state
==
0
)
return
0
;
acquire_console_sem
();
/* Wakeup chip */
if
(
pdev
->
dev
.
power_state
==
2
)
if
(
pdev
->
dev
.
power
.
power
_state
==
2
)
aty128_set_suspend
(
par
,
0
);
par
->
asleep
=
0
;
...
...
@@ -2430,7 +2430,7 @@ static int aty128_pci_resume(struct pci_dev *pdev)
release_console_sem
();
pdev
->
dev
.
power_state
=
0
;
pdev
->
dev
.
power
.
power
_state
=
0
;
printk
(
KERN_DEBUG
"aty128fb: resumed !
\n
"
);
...
...
drivers/video/aty/atyfb_base.c
View file @
9e0ce90e
...
...
@@ -2033,7 +2033,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, u32 state)
state
=
2
;
#endif
/* CONFIG_PPC_PMAC */
if
(
state
!=
2
||
state
==
pdev
->
dev
.
power_state
)
if
(
state
!=
2
||
state
==
pdev
->
dev
.
power
.
power
_state
)
return
0
;
acquire_console_sem
();
...
...
@@ -2062,7 +2062,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, u32 state)
release_console_sem
();
pdev
->
dev
.
power_state
=
state
;
pdev
->
dev
.
power
.
power
_state
=
state
;
return
0
;
}
...
...
@@ -2072,12 +2072,12 @@ static int atyfb_pci_resume(struct pci_dev *pdev)
struct
fb_info
*
info
=
pci_get_drvdata
(
pdev
);
struct
atyfb_par
*
par
=
(
struct
atyfb_par
*
)
info
->
par
;
if
(
pdev
->
dev
.
power_state
==
0
)
if
(
pdev
->
dev
.
power
.
power
_state
==
0
)
return
0
;
acquire_console_sem
();
if
(
pdev
->
dev
.
power_state
==
2
)
if
(
pdev
->
dev
.
power
.
power
_state
==
2
)
aty_power_mgmt
(
0
,
par
);
par
->
asleep
=
0
;
...
...
@@ -2093,7 +2093,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev)
release_console_sem
();
pdev
->
dev
.
power_state
=
0
;
pdev
->
dev
.
power
.
power
_state
=
0
;
return
0
;
}
...
...
drivers/video/aty/radeon_pm.c
View file @
9e0ce90e
...
...
@@ -898,7 +898,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, u32 state)
release_console_sem
();
pdev
->
dev
.
power_state
=
state
;
pdev
->
dev
.
power
.
power
_state
=
state
;
return
0
;
}
...
...
@@ -908,7 +908,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
struct
fb_info
*
info
=
pci_get_drvdata
(
pdev
);
struct
radeonfb_info
*
rinfo
=
info
->
par
;
if
(
pdev
->
dev
.
power_state
==
0
)
if
(
pdev
->
dev
.
power
.
power
_state
==
0
)
return
0
;
acquire_console_sem
();
...
...
@@ -935,7 +935,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
release_console_sem
();
pdev
->
dev
.
power_state
=
0
;
pdev
->
dev
.
power
.
power
_state
=
0
;
printk
(
KERN_DEBUG
"radeonfb: resumed !
\n
"
);
...
...
fs/sysfs/dir.c
View file @
9e0ce90e
...
...
@@ -38,7 +38,7 @@ static struct sysfs_dirent * sysfs_new_dirent(struct sysfs_dirent * parent_sd,
sd
=
kmalloc
(
sizeof
(
*
sd
),
GFP_KERNEL
);
if
(
!
sd
)
return
ERR_PTR
(
-
ENOMEM
)
;
return
NULL
;
memset
(
sd
,
0
,
sizeof
(
*
sd
));
atomic_set
(
&
sd
->
s_count
,
1
);
...
...
@@ -56,7 +56,7 @@ int sysfs_make_dirent(struct sysfs_dirent * parent_sd, struct dentry * dentry,
sd
=
sysfs_new_dirent
(
parent_sd
,
element
);
if
(
!
sd
)
return
0
;
return
-
ENOMEM
;
sd
->
s_mode
=
mode
;
sd
->
s_type
=
type
;
...
...
@@ -111,7 +111,7 @@ static int create_dir(struct kobject * k, struct dentry * p,
d_rehash
(
*
d
);
}
}
if
(
error
)
if
(
error
&&
(
error
!=
-
EEXIST
)
)
d_drop
(
*
d
);
dput
(
*
d
);
}
else
...
...
include/linux/device.h
View file @
9e0ce90e
...
...
@@ -268,12 +268,7 @@ struct device {
void
*
platform_data
;
/* Platform specific data (e.g. ACPI,
BIOS data relevant to device) */
struct
dev_pm_info
power
;
u32
power_state
;
/* Current operating state. In
ACPI-speak, this is D0-D3, D0
being fully functional, and D3
being off. */
unsigned
char
*
saved_state
;
/* saved device state */
u32
detach_state
;
/* State to enter when device is
detached from its driver. */
...
...
include/linux/kobject_uevent.h
View file @
9e0ce90e
...
...
@@ -28,6 +28,7 @@ enum kobject_action {
KOBJ_MOUNT
=
(
__force
kobject_action_t
)
0x04
,
/* mount event for block devices */
KOBJ_UMOUNT
=
(
__force
kobject_action_t
)
0x05
,
/* umount event for block devices */
KOBJ_OFFLINE
=
(
__force
kobject_action_t
)
0x06
,
/* offline event for hotplug devices */
KOBJ_ONLINE
=
(
__force
kobject_action_t
)
0x07
,
/* online event for hotplug devices */
};
...
...
lib/kobject_uevent.c
View file @
9e0ce90e
...
...
@@ -42,6 +42,8 @@ static char *action_to_string(enum kobject_action action)
return
"umount"
;
case
KOBJ_OFFLINE
:
return
"offline"
;
case
KOBJ_ONLINE
:
return
"online"
;
default:
return
NULL
;
}
...
...
@@ -287,10 +289,10 @@ void kobject_hotplug(struct kobject *kobj, enum kobject_action action)
spin_lock
(
&
sequence_lock
);
seq
=
++
hotplug_seqnum
;
spin_unlock
(
&
sequence_lock
);
sprintf
(
seq_buff
,
"SEQNUM=%ll
d"
,
(
long
long
)
seq
);
sprintf
(
seq_buff
,
"SEQNUM=%ll
u"
,
(
unsigned
long
long
)
seq
);
pr_debug
(
"%s: %s %s seq=%ll
d
%s %s %s %s %s
\n
"
,
__FUNCTION__
,
argv
[
0
],
argv
[
1
],
(
long
long
)
seq
,
pr_debug
(
"%s: %s %s seq=%ll
u
%s %s %s %s %s
\n
"
,
__FUNCTION__
,
argv
[
0
],
argv
[
1
],
(
unsigned
long
long
)
seq
,
envp
[
0
],
envp
[
1
],
envp
[
2
],
envp
[
3
],
envp
[
4
]);
send_uevent
(
action_string
,
kobj_path
,
envp
,
GFP_KERNEL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment