Skip to content

Commit 0f18e71

Browse files
mpeJeff Garzik
authored andcommitted
Use dcr_host_t.base in ibm_emac_mal
This requires us to do a sort-of fake dcr_map(), so that base is set properly. This will be fixed/removed when the device-tree-aware emac driver is merged. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent 7920369 commit 0f18e71

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎drivers/net/ibm_emac/ibm_emac_mal.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,10 @@ static int __init mal_probe(struct ocp_device *ocpdev)
413413
ocpdev->def->index);
414414
return -ENOMEM;
415415
}
416-
mal->dcrbase = maldata->dcr_base;
416+
417+
/* XXX This only works for native dcr for now */
418+
mal->dcrhost = dcr_map(NULL, maldata->dcr_base, 0);
419+
417420
mal->def = ocpdev->def;
418421

419422
INIT_LIST_HEAD(&mal->poll_list);

‎drivers/net/ibm_emac/ibm_emac_mal.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ struct mal_commac {
191191
};
192192

193193
struct ibm_ocp_mal {
194-
int dcrbase;
195194
dcr_host_t dcrhost;
196195

197196
struct list_head poll_list;
@@ -209,12 +208,12 @@ struct ibm_ocp_mal {
209208

210209
static inline u32 get_mal_dcrn(struct ibm_ocp_mal *mal, int reg)
211210
{
212-
return dcr_read(mal->dcrhost, mal->dcrbase + reg);
211+
return dcr_read(mal->dcrhost, mal->dcrhost.base + reg);
213212
}
214213

215214
static inline void set_mal_dcrn(struct ibm_ocp_mal *mal, int reg, u32 val)
216215
{
217-
dcr_write(mal->dcrhost, mal->dcrbase + reg, val);
216+
dcr_write(mal->dcrhost, mal->dcrhost.base + reg, val);
218217
}
219218

220219
/* Register MAL devices */

0 commit comments

Comments
 (0)