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
92183b34
Commit
92183b34
authored
Apr 05, 2009
by
Geert Uytterhoeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m68k: amiga - Floppy platform device conversion
Signed-off-by:
Geert Uytterhoeven
<
geert@linux-m68k.org
>
parent
ff2db7c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
arch/m68k/amiga/platform.c
arch/m68k/amiga/platform.c
+5
-0
drivers/block/amiflop.c
drivers/block/amiflop.c
+21
-26
No files found.
arch/m68k/amiga/platform.c
View file @
92183b34
...
...
@@ -72,6 +72,11 @@ static int __init amiga_init_devices(void)
if
(
AMIGAHW_PRESENT
(
AMI_AUDIO
))
platform_device_register_simple
(
"amiga-audio"
,
-
1
,
NULL
,
0
);
/* storage interfaces */
if
(
AMIGAHW_PRESENT
(
AMI_FLOPPY
))
platform_device_register_simple
(
"amiga-floppy"
,
-
1
,
NULL
,
0
);
return
0
;
}
...
...
drivers/block/amiflop.c
View file @
92183b34
...
...
@@ -66,6 +66,7 @@
#include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <asm/setup.h>
#include <asm/uaccess.h>
...
...
@@ -1696,34 +1697,18 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
return
get_disk
(
unit
[
drive
].
gendisk
);
}
static
int
__init
amiga_floppy_
init
(
void
)
static
int
__init
amiga_floppy_
probe
(
struct
platform_device
*
pdev
)
{
int
i
,
ret
;
if
(
!
MACH_IS_AMIGA
)
return
-
ENODEV
;
if
(
!
AMIGAHW_PRESENT
(
AMI_FLOPPY
))
return
-
ENODEV
;
if
(
register_blkdev
(
FLOPPY_MAJOR
,
"fd"
))
return
-
EBUSY
;
/*
* We request DSKPTR, DSKLEN and DSKDATA only, because the other
* floppy registers are too spreaded over the custom register space
*/
ret
=
-
EBUSY
;
if
(
!
request_mem_region
(
CUSTOM_PHYSADDR
+
0x20
,
8
,
"amiflop [Paula]"
))
{
printk
(
"fd: cannot get floppy registers
\n
"
);
goto
out_blkdev
;
}
ret
=
-
ENOMEM
;
if
((
raw_buf
=
(
char
*
)
amiga_chip_alloc
(
RAW_BUF_SIZE
,
"Floppy"
))
==
NULL
)
{
printk
(
"fd: cannot get chip mem buffer
\n
"
);
goto
out_
memregion
;
goto
out_
blkdev
;
}
ret
=
-
EBUSY
;
...
...
@@ -1792,18 +1777,13 @@ static int __init amiga_floppy_init(void)
free_irq
(
IRQ_AMIGA_DSKBLK
,
NULL
);
out_irq:
amiga_chip_free
(
raw_buf
);
out_memregion:
release_mem_region
(
CUSTOM_PHYSADDR
+
0x20
,
8
);
out_blkdev:
unregister_blkdev
(
FLOPPY_MAJOR
,
"fd"
);
return
ret
;
}
module_init
(
amiga_floppy_init
);
#ifdef MODULE
#if 0 /* not safe to unload */
void cleanup_module(void
)
static int __exit amiga_floppy_remove(struct platform_device *pdev
)
{
int i;
...
...
@@ -1820,12 +1800,25 @@ void cleanup_module(void)
custom.dmacon = DMAF_DISK; /* disable DMA */
amiga_chip_free(raw_buf);
blk_cleanup_queue(floppy_queue);
release_mem_region(CUSTOM_PHYSADDR+0x20, 8);
unregister_blkdev(FLOPPY_MAJOR, "fd");
}
#endif
#else
static
struct
platform_driver
amiga_floppy_driver
=
{
.
driver
=
{
.
name
=
"amiga-floppy"
,
.
owner
=
THIS_MODULE
,
},
};
static
int
__init
amiga_floppy_init
(
void
)
{
return
platform_driver_probe
(
&
amiga_floppy_driver
,
amiga_floppy_probe
);
}
module_init
(
amiga_floppy_init
);
#ifndef MODULE
static
int
__init
amiga_floppy_setup
(
char
*
str
)
{
int
n
;
...
...
@@ -1840,3 +1833,5 @@ static int __init amiga_floppy_setup (char *str)
__setup
(
"floppy="
,
amiga_floppy_setup
);
#endif
MODULE_ALIAS
(
"platform:amiga-floppy"
);
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