diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-03-18 11:25:11 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-03-18 11:25:11 +0100 |
commit | 72249651843f93d50c302833546fb2880052a80f (patch) | |
tree | 172a8af74ce161bc276856d7331dc0076055093c /drivers/i2c/busses/i2c-imx.c | |
parent | aef4075a0bcc7860eafa17be0c6e6cfcecc68206 (diff) | |
parent | 50c4c848d6b8743894cfcec166db475ef6140504 (diff) |
Merge tag '3.0-vybrid-ts2.13' into colibri_vfColibri_VF_LinuxImageV2.1Beta3_20140318
3.0-vybrid-ts2.13
Diffstat (limited to 'drivers/i2c/busses/i2c-imx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index e13e020cab2e..bd5269165aa0 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -125,6 +125,7 @@ static u16 __initdata i2c_clk_div[60][2] = { }; static MVF_SEMA4* sema4; +static int i2c_sema4_assigned = 0; #else static u16 __initdata i2c_clk_div[50][2] = { { 22, 0x20 }, { 24, 0x21 }, { 26, 0x22 }, { 28, 0x23 }, @@ -621,9 +622,14 @@ static int __init i2c_imx_probe(struct platform_device *pdev) #ifdef CONFIG_ARCH_MVF // for makeing sure not in use by MQX concurrently - if(mvf_sema4_assign(MVF_I2C_SEMAPHORE_NUMBER, &sema4)) { - dev_err(&pdev->dev, "could not assign MQX semaphore %d\n", MVF_I2C_SEMAPHORE_NUMBER); - goto fail5; + if(!i2c_sema4_assigned) + { + if(mvf_sema4_assign(MVF_I2C_SEMAPHORE_NUMBER, &sema4)) { + dev_err(&pdev->dev, "could not assign MQX semaphore %d\n", MVF_I2C_SEMAPHORE_NUMBER); + goto fail5; + } + // mark the semaphore as assigned + i2c_sema4_assigned = 1; } #endif |