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
Kirill Smelkov
linux
Commits
bb7f4552
Commit
bb7f4552
authored
Feb 29, 2004
by
Ben Collins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IEEE1394/dv(r1177): Fix dv1394 devfs cleanup.
parent
a7672d54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
28 deletions
+30
-28
drivers/ieee1394/dv1394.c
drivers/ieee1394/dv1394.c
+30
-28
No files found.
drivers/ieee1394/dv1394.c
View file @
bb7f4552
...
@@ -2222,7 +2222,7 @@ static int dv1394_init(struct ti_ohci *ohci, enum pal_or_ntsc format, enum modes
...
@@ -2222,7 +2222,7 @@ static int dv1394_init(struct ti_ohci *ohci, enum pal_or_ntsc format, enum modes
video
->
ohci
=
ohci
;
video
->
ohci
=
ohci
;
/* lower 2 bits of id indicate which of four "plugs"
/* lower 2 bits of id indicate which of four "plugs"
per host */
per host */
video
->
id
=
ohci
->
id
<<
2
;
video
->
id
=
ohci
->
host
->
id
<<
2
;
if
(
format
==
DV1394_NTSC
)
if
(
format
==
DV1394_NTSC
)
video
->
id
|=
mode
;
video
->
id
|=
mode
;
else
else
...
@@ -2302,47 +2302,49 @@ static void dv1394_un_init(struct video_card *video)
...
@@ -2302,47 +2302,49 @@ static void dv1394_un_init(struct video_card *video)
);
);
devfs_remove
(
"ieee1394/%s"
,
buf
);
devfs_remove
(
"ieee1394/%s"
,
buf
);
list_del
(
&
video
->
list
);
kfree
(
video
);
kfree
(
video
);
}
}
static
void
dv1394_remove_host
(
struct
hpsb_host
*
host
)
static
void
dv1394_remove_host
(
struct
hpsb_host
*
host
)
{
{
struct
ti_ohci
*
ohci
;
struct
video_card
*
video
;
struct
video_card
*
video
=
NULL
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
list_head
*
lh
,
*
templh
;
int
id
=
host
->
id
;
int
n
;
/* We only work with the OHCI-1394 driver */
/* We only work with the OHCI-1394 driver */
if
(
strcmp
(
host
->
driver
->
name
,
OHCI1394_DRIVER_NAME
))
if
(
strcmp
(
host
->
driver
->
name
,
OHCI1394_DRIVER_NAME
))
return
;
return
;
ohci
=
(
struct
ti_ohci
*
)
host
->
hostdata
;
/* find the corresponding video_cards */
do
{
struct
video_card
*
tmp_vid
;
video
=
NULL
;
/* find the corresponding video_cards */
spin_lock_irqsave
(
&
dv1394_cards_lock
,
flags
);
spin_lock_irqsave
(
&
dv1394_cards_lock
,
flags
);
list_for_each_entry
(
tmp_vid
,
&
dv1394_cards
,
list
)
{
if
(
!
list_empty
(
&
dv1394_cards
)
)
{
if
((
tmp_vid
->
id
>>
2
)
==
id
)
{
list_for_each_safe
(
lh
,
templh
,
&
dv1394_cards
)
{
list_del
(
&
tmp_vid
->
list
);
video
=
list_entry
(
lh
,
struct
video_card
,
list
)
;
video
=
tmp_vid
;
if
((
video
->
id
>>
2
)
==
ohci
->
id
)
break
;
dv1394_un_init
(
video
);
}
}
}
}
spin_unlock_irqrestore
(
&
dv1394_cards_lock
,
flags
);
spin_unlock_irqrestore
(
&
dv1394_cards_lock
,
flags
);
n
=
(
video
->
id
>>
2
);
if
(
video
)
dv1394_un_init
(
video
);
}
while
(
video
!=
NULL
);
devfs_remove
(
"ieee1394/dv/host%d/NTSC"
,
n
);
devfs_remove
(
"ieee1394/dv/host%d/NTSC"
,
id
);
devfs_remove
(
"ieee1394/dv/host%d/PAL"
,
n
);
devfs_remove
(
"ieee1394/dv/host%d/PAL"
,
id
);
devfs_remove
(
"ieee1394/dv/host%d"
,
n
);
devfs_remove
(
"ieee1394/dv/host%d"
,
id
);
}
}
static
void
dv1394_add_host
(
struct
hpsb_host
*
host
)
static
void
dv1394_add_host
(
struct
hpsb_host
*
host
)
{
{
struct
ti_ohci
*
ohci
;
struct
ti_ohci
*
ohci
;
int
id
=
host
->
id
;
/* We only work with the OHCI-1394 driver */
/* We only work with the OHCI-1394 driver */
if
(
strcmp
(
host
->
driver
->
name
,
OHCI1394_DRIVER_NAME
))
if
(
strcmp
(
host
->
driver
->
name
,
OHCI1394_DRIVER_NAME
))
...
@@ -2350,9 +2352,9 @@ static void dv1394_add_host (struct hpsb_host *host)
...
@@ -2350,9 +2352,9 @@ static void dv1394_add_host (struct hpsb_host *host)
ohci
=
(
struct
ti_ohci
*
)
host
->
hostdata
;
ohci
=
(
struct
ti_ohci
*
)
host
->
hostdata
;
devfs_mk_dir
(
"ieee1394/dv/host%d"
,
ohci
->
id
);
devfs_mk_dir
(
"ieee1394/dv/host%d"
,
id
);
devfs_mk_dir
(
"ieee1394/dv/host%d/NTSC"
,
ohci
->
id
);
devfs_mk_dir
(
"ieee1394/dv/host%d/NTSC"
,
id
);
devfs_mk_dir
(
"ieee1394/dv/host%d/PAL"
,
ohci
->
id
);
devfs_mk_dir
(
"ieee1394/dv/host%d/PAL"
,
id
);
dv1394_init
(
ohci
,
DV1394_NTSC
,
MODE_RECEIVE
);
dv1394_init
(
ohci
,
DV1394_NTSC
,
MODE_RECEIVE
);
dv1394_init
(
ohci
,
DV1394_NTSC
,
MODE_TRANSMIT
);
dv1394_init
(
ohci
,
DV1394_NTSC
,
MODE_TRANSMIT
);
...
@@ -2369,7 +2371,7 @@ static void dv1394_add_host (struct hpsb_host *host)
...
@@ -2369,7 +2371,7 @@ static void dv1394_add_host (struct hpsb_host *host)
static
void
dv1394_host_reset
(
struct
hpsb_host
*
host
)
static
void
dv1394_host_reset
(
struct
hpsb_host
*
host
)
{
{
struct
ti_ohci
*
ohci
;
struct
ti_ohci
*
ohci
;
struct
video_card
*
video
=
NULL
;
struct
video_card
*
video
=
NULL
,
*
tmp_vid
;
unsigned
long
flags
;
unsigned
long
flags
;
/* We only work with the OHCI-1394 driver */
/* We only work with the OHCI-1394 driver */
...
@@ -2381,10 +2383,10 @@ static void dv1394_host_reset(struct hpsb_host *host)
...
@@ -2381,10 +2383,10 @@ static void dv1394_host_reset(struct hpsb_host *host)
/* find the corresponding video_cards */
/* find the corresponding video_cards */
spin_lock_irqsave
(
&
dv1394_cards_lock
,
flags
);
spin_lock_irqsave
(
&
dv1394_cards_lock
,
flags
);
if
(
!
list_empty
(
&
dv1394_cards
)
)
{
list_for_each_entry
(
tmp_vid
,
&
dv1394_cards
,
list
)
{
list_for_each_entry
(
video
,
&
dv1394_cards
,
list
)
{
if
((
tmp_vid
->
id
>>
2
)
==
host
->
id
)
{
if
((
video
->
id
>>
2
)
==
ohci
->
id
)
video
=
tmp_vid
;
break
;
break
;
}
}
}
}
spin_unlock_irqrestore
(
&
dv1394_cards_lock
,
flags
);
spin_unlock_irqrestore
(
&
dv1394_cards_lock
,
flags
);
...
...
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