projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[powerpc.git]
/
drivers
/
macintosh
/
mediabay.c
diff --git
a/drivers/macintosh/mediabay.c
b/drivers/macintosh/mediabay.c
index
b856bb6
..
0acf2f7
100644
(file)
--- a/
drivers/macintosh/mediabay.c
+++ b/
drivers/macintosh/mediabay.c
@@
-10,7
+10,6
@@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
-#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
@@
-647,6
+646,7
@@
static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de
struct media_bay_info* bay;
u32 __iomem *regbase;
struct device_node *ofnode;
struct media_bay_info* bay;
u32 __iomem *regbase;
struct device_node *ofnode;
+ unsigned long base;
int i;
ofnode = mdev->ofdev.node;
int i;
ofnode = mdev->ofdev.node;
@@
-656,10
+656,11
@@
static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de
if (macio_request_resources(mdev, "media-bay"))
return -EBUSY;
/* Media bay registers are located at the beginning of the
if (macio_request_resources(mdev, "media-bay"))
return -EBUSY;
/* Media bay registers are located at the beginning of the
- * mac-io chip, we get the parent address for now (hrm...)
+ * mac-io chip, for now, we trick and align down the first
+ * resource passed in
*/
*/
- regbase = (u32 __iomem *)
-
ioremap(ofnode->parent->addrs[0].address
, 0x100);
+ base = macio_resource_start(mdev, 0) & 0xffff0000u;
+
regbase = (u32 __iomem *)ioremap(base
, 0x100);
if (regbase == NULL) {
macio_release_resources(mdev);
return -ENOMEM;
if (regbase == NULL) {
macio_release_resources(mdev);
return -ENOMEM;
@@
-837,8
+838,8
@@
static int __init media_bay_init(void)
media_bays[i].cd_index = -1;
#endif
}
media_bays[i].cd_index = -1;
#endif
}
- if (
_machine != _MACH_Pmac
)
- return
-ENODEV
;
+ if (
!machine_is(powermac)
)
+ return
0
;
macio_register_driver(&media_bay_driver);
macio_register_driver(&media_bay_driver);