c
#define CHECK_NULL_RETURN(ptr, ret) do { if (!(ptr)) return (ret); } while (0)

struct property *of_find_property(const struct device_node *np,
                                  const char *name,
                                  int *lenp)
{
    CHECK_NULL_RETURN(np, NULL);

    struct property *pp;
    unsigned long flags;

    raw_spin_lock_irqsave(&devtree_lock, flags);
    pp = __of_find_property(np, name, lenp);
    // ... rest of the function
}
