Skip to content

Commit

Permalink
beaglebone: correct ocp mapping in support for kernel 4.x
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Nov 26, 2016
1 parent c51f1e3 commit 0d02bdc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions platforms/beaglebone/beaglebone_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ func NewAdaptor() *Adaptor {

func (b *Adaptor) setSlots() {
ocp := "/sys/devices/ocp.*"
g, _ := glob(ocp)
b.ocp = g[0]

slots := "/sys/devices/bone_capemgr.*"

if b.kernel == "4" {
ocp = "/sys/devices/platform/ocp/ocp*"
slots = "/sys/devices/platform/bone_capemgr"
}

g, _ := glob(ocp)
b.ocp = g[0]

g, _ = glob(slots)
b.slots = fmt.Sprintf("%v/slots", g[0])
}
Expand Down

0 comments on commit 0d02bdc

Please sign in to comment.