qcacmn: Add check for supported register

Register offsets have 2 possible invalid values.
need to check for both values.

Change-Id: I6168aa46c4af66169284b98dee26ab56e4ed12c5
CRs-Fixed: 1012824
This commit is contained in:
Houston Hoffman
2016-05-05 16:10:48 -07:00
committed by Gerrit - the friendly Code Review server
parent 3db96a43b6
commit 056d452238
3 changed files with 18 additions and 3 deletions

View File

@@ -19,6 +19,21 @@
#ifndef REG_STRUCT_H
#define REG_STRUCT_H
#define MISSING_REGISTER 0
#define UNSUPPORTED_REGISTER_OFFSET 0xffffffff
/**
* is_register_supported() - return true if the register offset is valid
* @reg: register address being checked
*
* Return: true if the register offset is valid
*/
static inline bool is_register_supported(uint32_t reg)
{
return (reg != MISSING_REGISTER) &&
(reg != UNSUPPORTED_REGISTER_OFFSET);
}
struct targetdef_s {
uint32_t d_RTC_SOC_BASE_ADDRESS;
uint32_t d_RTC_WMAC_BASE_ADDRESS;